public void OnTriggerExit(Collider other) { computer = null; desk = null; trashContainer = null; shelves = null; }
public static void SwitchTrashWithIds(int itemId1, int itemId2) { TrashContainer container = GameMain.data.trashSystem.container; TrashObject to = container.trashObjPool[itemId1]; TrashData td = container.trashDataPool[itemId1]; container.trashObjPool[itemId1] = container.trashObjPool[itemId2]; container.trashDataPool[itemId1] = container.trashDataPool[itemId2]; container.trashObjPool[itemId2] = to; container.trashDataPool[itemId2] = td; }
private void OnTriggerEnter(Collider other) { GameObject go = other.gameObject; Trash e = go.GetComponent <Trash>(); if (e != null) { // Update how many bottles have been collected, correctly or otherwise. e.type.incrementCollectedItems(); if (e.type == type) { points.Variable.ApplyChange(type.PointValue); e.type.incrementCorrectCollectedItems(); } TrashContainer trashContainer = GetComponentInParent <TrashContainer>(); trashContainer.UpdateLabel(e.type); Destroy(e.gameObject); Collect.Raise(); } }
public void OnTriggerStay(Collider other) { if (other.gameObject.CompareTag("Computer")) { computer = other.GetComponent <Computer>(); } if (other.gameObject.CompareTag("Desk")) { desk = other.GetComponent <Desk>(); } if (other.gameObject.CompareTag("TrashContainer")) { trashContainer = other.GetComponent <TrashContainer>(); } if (other.gameObject.CompareTag("Shelves")) { shelves = other.GetComponent <Shelves>(); } }