Esempio n. 1
0
 private void Start()
 {
     core  = FindObjectOfType(typeof(KitCore)) as KitCore;
     piece = GetComponent <KitPiece>();
     for (int i = 0; i < core.requiredPieces.Length; i++)
     {
         if (core.requiredPieces[i].piece.PieceName == piece.PieceName)
         {
             core.requiredPieces[i].Amount++;
             if (core.requiredPieces[i].Amount > core.requiredPieces[i].maxAmount)
             {
                 core.RemovePiece(piece);
             }
             break;
         }
     }
 }
Esempio n. 2
0
 public void RemovePiece(KitPiece piece)
 {
     Destroy(piece.gameObject);
     pieces.Remove(piece);
 }