Exemple #1
0
 public GameObject MakeFruit(FruitStandardModel fruit)
 {
     if (fruit.level < fruitPrefabs.Length)
     {
         GameObject fruitObject = Instantiate(fruitPrefabs[fruit.level]);
         if (fruitObject.TryGetComponent(out FruitStandard fruitComp))
         {
             fruitComp.GetFruitReceiver()(fruit);
         }
         return(fruitObject);
     }
     return(null);
 }
Exemple #2
0
 public void ReceiveFruit(FruitStandardModel fruit)
 {
     level = fruit.level;
 }