コード例 #1
0
 public void OnInteract(GameObject playerobject)
 {
     playerInteractions = playerobject.GetComponent <PlayerInteractions>();
     if (playerInteractions.player == player)//Get vegetable chopped
     {
         if (playerInteractions.GetVegetable(0) != null)
         {
             if (combination == null)
             {
                 combination = playerInteractions.RemoveVegetable();
             }
             else
             {
                 combination += "," + playerInteractions.RemoveVegetable();
             }
             playerInteractions.StartCooking();
         }
         else if (playerInteractions.GetVegetable(0) == null && playerInteractions.combination == null && combination != null)//pickup up combo
         {
             playerInteractions.combination = combination;
             combination = null;
         }
         else if (playerInteractions.GetVegetable(0) == null && playerInteractions.combination != null && combination == null)//place combo on choppingboard
         {
             combination = playerInteractions.combination;
             playerInteractions.combination = null;
         }
     }
 }
コード例 #2
0
ファイル: Dustbin.cs プロジェクト: Prakhargoel8c/Realworld
 public void OnInteract(GameObject playerobject)
 {
     playerInteractions = playerobject.GetComponent <PlayerInteractions>();
     if (playerInteractions.combination != null)
     {
         playerInteractions.combination = null;
         playerInteractions.GetUI.AddScore(GameConstants.combinationtrash);
     }
     else if (playerInteractions.GetVegetable(0) != null)
     {
         playerInteractions.RemoveVegetable();
         playerInteractions.GetUI.AddScore(GameConstants.vegetabletrash);
     }
 }
コード例 #3
0
ファイル: Plate.cs プロジェクト: Prakhargoel8c/Realworld
 public void OnInteract(GameObject playerobject)
 {
     playerInteractions = playerobject.GetComponent <PlayerInteractions>();
     if (playerInteractions.player == this.player)
     {
         if (vegetable == null && playerInteractions.GetVegetable(0) != null)
         {
             vegetable = playerInteractions.RemoveVegetable();
         }
         else if (playerInteractions.GetVegetable(1) == null)
         {
             playerInteractions.AddVegetable(vegetable);
             vegetable = null;
         }
     }
 }