/// <summary> /// Puts the Souvenir in an passive state if it is currently active. /// </summary> private void DisableActiveState() { if (state != SouvenirState.Active) { return; } activeStateVisuals.SetActive(false); eventAudioManager.PlayAudio(EventAudioManager.TriggerType.SouvenirInactive); EnableSpatialMapping(); state = SouvenirState.Passive; ActiveStateDisabled.RaiseEvent(); }
/// <summary> /// Wakes up the souvenir, putting it in passive state. /// </summary> private void EnablePassiveState() { if (CanBecomePassive && activeSouvenirManager != null) { bool becamePassive = activeSouvenirManager.TryMakePassive(this); if (becamePassive) { ShowContent(); state = SouvenirState.Passive; PassiveStateEnabled.RaiseEvent(); } } }
private void ForceSleep() { DisableActiveState(); // Force disable passive. if (activeSouvenirManager != null) { activeSouvenirManager.MakeInactive(this); } activeStateVisuals.SetActive(false); state = SouvenirState.Off; PassiveStateDisabled.RaiseEvent(); }
/// <summary> /// Disables the souvenir, puts it in sleeping state. /// </summary> private void DisablePassiveState() { if (!CanDisablePassive) { return; } if (activeSouvenirManager != null) { activeSouvenirManager.MakeInactive(this); } activeStateVisuals.SetActive(false); state = SouvenirState.Off; PassiveStateDisabled.RaiseEvent(); }
/// <summary> /// Puts the Souvenir in an active state. /// </summary> private void EnableActiveState() { if (CanBecomeActive) { if (activeSouvenirManager != null) { activeSouvenirManager.MakeActive(this); } DisableSpatialMapping(); ShowContent(); activeStateVisuals.SetActive(true); eventAudioManager.PlayAudio(EventAudioManager.TriggerType.SouvenirActive); state = SouvenirState.Active; ActiveStateEnabled.RaiseEvent(); } }