コード例 #1
0
 public void switchItems(EmptyTop topSurface)
 {
     if (topSurface.storedObject.tag == "Plate")
     {
         if (topSurface.storedObject.GetComponent <PlateOrder>().PlaceOnPlate(Item) != null)
         {
             Item = null;
         }
     }
     else if (Item.tag == "Plate")
     {
         if (Item.GetComponent <PlateOrder>().PlaceOnPlate(topSurface.storedObject) != null)
         {
             topSurface.storedObject = null;
             topSurface.StoreItem(Item);
         }
     }
     else
     {
         //tempStorage = topSurface.storedObject;
         //topSurface.storedObject = null;
         //topSurface.StoreItem(Item);
         //Item = tempStorage;
         //tempStorage = null;
     }
 }
コード例 #2
0
    public void PlayerInteraction(GameObject item)
    {
        GameObject Item = item;

        foreach (GameObject emptytop in emptyTops)
        {
            EmptyTop emptytopScript = emptytop.GetComponent <EmptyTop>();
            if (emptytopScript.playercollision)
            {
                Debug.Log(emptytop.name);
                emptytopScript.PlayerInteraction(Item);
                break;
            }
        }
    }
コード例 #3
0
 public void giveItem(EmptyTop emptyTop)
 {
     Debug.Log("Item van handen naar countertop");
     Item.transform.parent = emptyTop.itemPosition;
     Item = null;
 }