public void SendToEvent(int callEvent) { try { switch (eventNumber) { case 1: break; case 2: eventTwo.SetMessages(callEvent); break; case 3: eventThree.SetEvent(callEvent); break; case 4: eventFour.SetEvent(callEvent); break; case 5: eventFive.SetEvent(callEvent); break; case 6: eventSix.SetEvent(callEvent); break; } } catch (NullReferenceException ex) { Debug.LogWarning("Event " + eventNumber + " not found > " + ex.Message); } }
void Update() { if (m_Active) { m_Count += Time.deltaTime; if (m_Count > m_FocusTime) { m_CameraFollow.SetPlayerAsTarget(); m_Bars.SetBool("isActive", false); m_Active = false; m_Event.SetMessages(m_CallEvent); if (m_DesactivateTrigger) { GetComponent <BoxCollider>().enabled = false; } } } }
private void OnTriggerEnter() { m_Event.SetMessages(m_EventNumber); GetComponent <BoxCollider>().enabled = false; }