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; } }
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; } } }
public void giveItem(EmptyTop emptyTop) { Debug.Log("Item van handen naar countertop"); Item.transform.parent = emptyTop.itemPosition; Item = null; }