コード例 #1
0
ファイル: Checkpoint.cs プロジェクト: Mannilie/Fidget
 private void Awake()
 {
     collider = GetComponent <Collider2D>();
     gems     = gemParent.GetComponentsInChildren <Gem>();
     gemSlots = slotsParent.GetComponentInChildren <Slots>();
     anim     = gemSlots.GetComponentInChildren <Animator>();
     // Set length required for gem slots
     gemSlots.SetLength(gems.Length);
     foreach (var gem in gems)
     {
         gem.checkpoint = this;
     }
     // Assign Gems to Available Slots
     for (int i = 0; i < gemSlots.Length; i++)
     {
         Gem current = gems[i];
         current.slot = gemSlots.GetSlot(i);
     }
 }