示例#1
0
 protected override void OnDisable()
 {
     base.OnDisable();
     this.m_Animator.SetBool(this.m_BWatch, false);
     Watch.Get().gameObject.SetActive(false);
     PlayerAudioModule.Get().PlayWatchHideSound();
     if (this.m_InInventory)
     {
         Player.Get().m_OpenBackpackSheduled = true;
         this.m_InInventory = false;
     }
 }
示例#2
0
 protected override void OnEnable()
 {
     base.OnEnable();
     this.m_Animator.SetBool(this.m_BWatch, true);
     Watch.Get().gameObject.SetActive(true);
     PlayerAudioModule.Get().PlayWatchShowSound();
     this.m_InInventory = Inventory3DManager.Get().gameObject.activeSelf;
     if (this.m_InInventory)
     {
         Inventory3DManager.Get().Deactivate();
     }
 }
示例#3
0
    private void UpdateInputs()
    {
        float axis = Input.GetAxis("Mouse ScrollWheel");

        if (axis > 0.01f)
        {
            this.m_Mode++;
            if (this.m_Mode >= WatchMode.Count)
            {
                this.m_Mode = WatchMode.PlayerParameters;
            }
            if (this.m_Mode == WatchMode.Sanity)
            {
                this.m_Mode = WatchMode.PlayerParameters;
            }
            PlayerAudioModule.Get().PlayWatchSwitchTabSound();
        }
        else if (axis < -0.01f)
        {
            this.m_Mode--;
            if (this.m_Mode < WatchMode.PlayerParameters)
            {
                this.m_Mode = WatchMode.Sanity;
            }
            if (this.m_Mode == WatchMode.Sanity)
            {
                this.m_Mode = WatchMode.Hour;
            }
            PlayerAudioModule.Get().PlayWatchSwitchTabSound();
        }
        if (this.m_Mode == WatchMode.Sanity)
        {
            Watch.Get().SetState(Watch.State.Sanity);
        }
        else if (this.m_Mode == WatchMode.Hour)
        {
            Watch.Get().SetState(Watch.State.Time);
        }
        else if (this.m_Mode == WatchMode.PlayerParameters)
        {
            Watch.Get().SetState(Watch.State.Macronutrients);
        }
        else if (this.m_Mode == WatchMode.Compass)
        {
            Watch.Get().SetState(Watch.State.Compass);
        }
    }
 public void StopCutscene()
 {
     if (!this.m_CurrentCutscene)
     {
         return;
     }
     this.m_CurrentCutscene.Stop();
     this.m_CurrentCutscene = null;
     if (this.m_PlayableDirectorEx != null && this.m_PlayableDirectorEx.m_FollowOffsetHelper)
     {
         this.m_CharacterController.detectCollisions = true;
     }
     this.m_PlayableDirectorEx = null;
     Watch.Get().gameObject.SetActive(false);
     Player.Get().StopController(PlayerControllerType.PlayerCutscene);
     Player.Get().m_IsInAir          = false;
     Player.Get().m_LastPosOnGround  = Player.Get().transform.position;
     Player.Get().m_LastTimeOnGround = Time.time;
 }
 private void OnSetMode()
 {
     PlayerAudioModule.Get().PlayWatchSwitchTabSound();
     if (this.m_Mode == WatchMode.Sanity)
     {
         Watch.Get().SetState(Watch.State.Sanity);
         return;
     }
     if (this.m_Mode == WatchMode.Hour)
     {
         Watch.Get().SetState(Watch.State.Time);
         return;
     }
     if (this.m_Mode == WatchMode.PlayerParameters)
     {
         Watch.Get().SetState(Watch.State.Macronutrients);
         return;
     }
     if (this.m_Mode == WatchMode.Compass)
     {
         Watch.Get().SetState(Watch.State.Compass);
     }
 }
    public void PlayCutscene(string name)
    {
        if (Scenario.Get().m_IsLoading)
        {
            return;
        }
        PlayableDirector cutscene = this.GetCutscene(name);

        if (!cutscene)
        {
            return;
        }
        if (Inventory3DManager.Get().gameObject.activeSelf)
        {
            Inventory3DManager.Get().Deactivate();
        }
        this.m_CurrentCutscene = cutscene;
        this.m_CurrentCutscene.Play();
        this.m_PlayTime = 0f;
        Watch.Get().gameObject.SetActive(true);
        Player.Get().StartController(PlayerControllerType.PlayerCutscene);
        PlayableDirectorEx component = cutscene.gameObject.GetComponent <PlayableDirectorEx>();

        if (component != null)
        {
            this.m_PlayableDirectorEx = component;
            if (component.m_FollowOffsetHelper)
            {
                this.m_StoreStartPosition = true;
                return;
            }
        }
        else
        {
            DebugUtils.Assert("Missing PlayableDirectorEx in cutscene - " + name, true, DebugUtils.AssertType.Info);
        }
    }