Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
SpriteSheet Class Reference
Inheritance diagram for SpriteSheet:

Static Public Member Functions

static void Add (Sprite sprite)
 
static void Add (string path)
 
static Sprite Get (string id)
 
static Sprite Get (string path, string id)
 

Static Public Attributes

static Dictionary< string, Sprite > dict = new Dictionary<string, Sprite>()
 
static HashSet< string > loadedPath = new HashSet<string>()
 

Detailed Description

Definition at line 4 of file SpriteSheet.cs.

Member Function Documentation

◆ Add() [1/2]

static void SpriteSheet.Add ( Sprite  sprite)
inlinestatic

Definition at line 10 of file SpriteSheet.cs.

11 {
12 dict[sprite.name] = sprite;
13 }
static Dictionary< string, Sprite > dict
Definition: SpriteSheet.cs:6

References dict.

Referenced by Get(), Hoard.GetSprite(), and Core.Init().

◆ Add() [2/2]

static void SpriteSheet.Add ( string  path)
inlinestatic

Definition at line 15 of file SpriteSheet.cs.

16 {
17 if (!loadedPath.Contains(path))
18 {
19 Sprite[] array = Resources.LoadAll<Sprite>(path);
20 foreach (Sprite sprite in array)
21 {
22 dict[sprite.name] = sprite;
23 }
24 loadedPath.Add(path);
25 }
26 }
static HashSet< string > loadedPath
Definition: SpriteSheet.cs:8

References dict, and loadedPath.

◆ Get() [1/2]

◆ Get() [2/2]

static Sprite SpriteSheet.Get ( string  path,
string  id 
)
inlinestatic

Definition at line 33 of file SpriteSheet.cs.

34 {
35 if (!loadedPath.Contains(path))
36 {
37 Add(path);
38 }
39 dict.TryGetValue(id, out var value);
40 return value;
41 }
static void Add(Sprite sprite)
Definition: SpriteSheet.cs:10

References Add(), dict, and loadedPath.

Member Data Documentation

◆ dict

Dictionary<string, Sprite> SpriteSheet.dict = new Dictionary<string, Sprite>()
static

Definition at line 6 of file SpriteSheet.cs.

Referenced by Add(), Core.Awake(), Get(), and Scene.InitPass().

◆ loadedPath

HashSet<string> SpriteSheet.loadedPath = new HashSet<string>()
static

Definition at line 8 of file SpriteSheet.cs.

Referenced by Add(), Core.Awake(), and Get().


The documentation for this class was generated from the following file: