private void OnTriggerExit(Collider other) { // Check ingredient first Ingredient ingredient = other.GetComponent <Ingredient>(); if (ingredient != null) { SendMessageUpwards("OnClearIngredient", ingredient); return; } // Check ingredient first ChoppingTable choppingTable = other.GetComponent <ChoppingTable>(); if (choppingTable != null) { SendMessageUpwards("OnClearChoppingTable", choppingTable); return; } // Check garbage TrashCan trashCan = other.GetComponent <TrashCan>(); if (trashCan != null) { SendMessageUpwards("OnClearTrashCan", trashCan); return; } }
// Player near a chopping table public void OnFoundChoppingTable(ChoppingTable choppingTable) { if (choppingTable.m_playerID == PLAYER_ID.ANYONE || choppingTable.m_playerID == m_playerID) { Debug.Log("OnFoundTable"); Main.AUDIO_Info(); Main.SendFloater(choppingTable.transform.position + Vector3.up, 2.0f, ("Your chopping table")); m_focusChoppingTable = choppingTable; } }
public void OnClearChoppingTable(ChoppingTable choppingTable) { Debug.Log("OnClearTable"); m_focusChoppingTable = null; }