Beispiel #1
0
 void AnimatAllVariations()
 {
     //Find the tile sprite type array by using string reflection (should only happen at awake or if tile sprite type changes)
     Sprite[] tileXx = (Sprite[])tile.GetType().GetField("tile" + tile.tileSprite).GetValue(tile);
     if (tileXx.Length > 1)
     {
         tileX             = tileXx;
         currentTileSprite = tile.tileSprite;
         Invoke("Animate", speed);
     }
 }
Beispiel #2
0
 void ChangeCurrentSprite()
 {
     //Fix error event error
     if (preCurrentSprite != currentSprite)
     {
         currentSprite = preCurrentSprite;
         Sprite[] arr = (Sprite[])tile.GetType().GetField("tile" + tile.SpriteNumberToName(currentSprite)).GetValue(tile);
         if (arr != null)
         {
             currentArraySize = arr.Length;
         }
     }
 }