public void UpdateServerSlot(ServerSlotState a_state, ServerSlotType a_type) { switch (a_state) { case ServerSlotState.Insert: m_currentActivatedSlots++; Insert(a_type); if (IsActivated()) { // ALL SLOTS ENABLED Debug.Log("Server [" + gameObject.name + "] activated."); GetComponent <AudioSource>().Play(); // ENABLE SOUND } break; case ServerSlotState.Remove: Remove(a_type); if (IsActivated()) { // server is currently activated, but object is pulled off // server will be deactivated Debug.Log("Server [" + gameObject.name + "] deactivated."); GetComponent <AudioSource>().Play(); // DISABLE SOUND } m_currentActivatedSlots--; break; } // update info screen m_notebookScreen.GetComponent <IServerNotebook>().ChangeState(this); }
public void PlaySound(ServerSlotState a_state) { AudioSource s = GetComponent <AudioSource>(); switch (a_state) { case ServerSlotState.Insert: if (IsActivated()) { s.clip = m_activated; } else { s.clip = m_insert; } s.Play(); break; case ServerSlotState.Remove: s.clip = m_remove; s.Play(); break; } }