Exemple #1
0
 private void Awake()
 {
     Instance          = this;
     spriteDictionary  = new Dictionary <string, Sprite>();
     spriteableObjects = Resources.FindObjectsOfTypeAll <SpriteableObject>();
     foreach (SpriteableObject so in spriteableObjects)
     {
         spriteDictionary.Add(so.name, so.sprite);
     }
 }
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(this);
         return;
     }
     spriteDictionary  = new Dictionary <string, Sprite>();
     spriteableObjects = Resources.FindObjectsOfTypeAll <SpriteableObject>();
     foreach (SpriteableObject so in spriteableObjects)
     {
         spriteDictionary.Add(so.name, so.sprite);
     }
 }