Beispiel #1
0
        /// <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();
        }
Beispiel #2
0
 /// <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();
         }
     }
 }
Beispiel #3
0
        private void ForceSleep()
        {
            DisableActiveState();

            // Force disable passive.
            if (activeSouvenirManager != null)
            {
                activeSouvenirManager.MakeInactive(this);
            }

            activeStateVisuals.SetActive(false);
            state = SouvenirState.Off;
            PassiveStateDisabled.RaiseEvent();
        }
Beispiel #4
0
        /// <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();
        }
Beispiel #5
0
        /// <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();
            }
        }