public void WakeUpOnFade()
 {
     this.m_PassingOutProgress = 0f;
     this.SetState(ConsciousnessController.ConsciousnessState.WakingUp);
     this.m_Animator.SetInteger(this.m_PassOutHash, 2);
     FadeSystem.Get().FadeIn(FadeType.All, null, 1.5f);
 }
Ejemplo n.º 2
0
 protected override void Update()
 {
     base.Update();
     HUDStartSurvivalSplash.State state = this.m_State;
     if (state != HUDStartSurvivalSplash.State.Enter)
     {
         if (state != HUDStartSurvivalSplash.State.Normal)
         {
             if (state == HUDStartSurvivalSplash.State.Exit)
             {
                 if (this.m_Text.color.a > 0f)
                 {
                     Color color = this.m_Text.color;
                     color.a          -= Time.deltaTime;
                     color.a           = Mathf.Clamp01(color.a);
                     this.m_Text.color = color;
                 }
                 else if (this.m_CanvasGroup.alpha > 0f)
                 {
                     this.m_CanvasGroup.alpha -= Time.deltaTime;
                     this.m_CanvasGroup.alpha  = Mathf.Clamp01(this.m_CanvasGroup.alpha);
                     if (this.m_CanvasGroup.alpha == 0f)
                     {
                         this.m_Active = false;
                     }
                 }
             }
         }
         else if (Input.GetKeyDown(KeyCode.Space))
         {
             if (this.m_WasPause)
             {
                 MainLevel.Instance.Pause(false);
             }
             this.m_State = HUDStartSurvivalSplash.State.Exit;
         }
         else if (!MainLevel.Instance.IsPause() && FadeSystem.Get().CanStartFade())
         {
             this.m_WasPause = true;
             MainLevel.Instance.Pause(true);
         }
     }
     else if (this.m_CanvasGroup.alpha < 1f)
     {
         this.m_CanvasGroup.alpha += Time.deltaTime;
         this.m_CanvasGroup.alpha  = Mathf.Clamp01(this.m_CanvasGroup.alpha);
     }
     else
     {
         Color color2 = this.m_Text.color;
         color2.a         += Time.deltaTime;
         color2.a          = Mathf.Clamp01(color2.a);
         this.m_Text.color = color2;
         if (color2.a == 1f)
         {
             this.m_State = HUDStartSurvivalSplash.State.Normal;
         }
     }
 }
 public void WakeUp()
 {
     this.m_StartPassOutTime = 0f;
     if (!FadeSystem.Get().m_FadingOut&& !FadeSystem.Get().m_FadeOut)
     {
         FadeSystem.Get().FadeOut(FadeType.All, new VDelegate(this.WakeUpOnFade), 1.5f, null);
     }
 }
Ejemplo n.º 4
0
 public void WakeUpOnFade()
 {
     this.m_Player.UnblockMoves();
     this.m_Player.UnblockRotation();
     this.m_MovesBlocked       = false;
     this.m_PassingOutProgress = 0f;
     this.ApplyParamsOnWakeUp();
     this.SetState(ConsciousnessController.ConsciousnessState.None);
     this.Stop();
     this.m_Animator.SetInteger(this.m_PassOutHash, 2);
     FadeSystem.Get().FadeIn(FadeType.All, null, 1.5f);
 }
Ejemplo n.º 5
0
    protected override void Update()
    {
        base.Update();
        switch (this.m_State)
        {
        case HUDStartSurvivalSplash.State.Enter:
        {
            if (this.m_CanvasGroup.alpha < 1f)
            {
                this.m_CanvasGroup.alpha += Time.deltaTime;
                this.m_CanvasGroup.alpha  = Mathf.Clamp01(this.m_CanvasGroup.alpha);
                return;
            }
            Color color = this.m_Text.color;
            color.a          += Time.deltaTime;
            color.a           = Mathf.Clamp01(color.a);
            this.m_Text.color = color;
            if (color.a == 1f)
            {
                this.m_State = HUDStartSurvivalSplash.State.Normal;
                return;
            }
            break;
        }

        case HUDStartSurvivalSplash.State.Normal:
            if (Input.GetKeyDown(KeyCode.Space))
            {
                if (this.m_WasPause)
                {
                    MainLevel.Instance.Pause(false);
                }
                this.m_State = HUDStartSurvivalSplash.State.Exit;
                return;
            }
            if (!MainLevel.Instance.IsPause() && FadeSystem.Get().CanStartFade())
            {
                this.m_WasPause = true;
                MainLevel.Instance.Pause(true);
                return;
            }
            break;

        case HUDStartSurvivalSplash.State.Exit:
            if (this.m_Text.color.a > 0f)
            {
                Color color2 = this.m_Text.color;
                color2.a         -= Time.deltaTime;
                color2.a          = Mathf.Clamp01(color2.a);
                this.m_Text.color = color2;
                return;
            }
            if (this.m_CanvasGroup.alpha > 0f)
            {
                this.m_CanvasGroup.alpha -= Time.deltaTime;
                this.m_CanvasGroup.alpha  = Mathf.Clamp01(this.m_CanvasGroup.alpha);
                if (this.m_CanvasGroup.alpha == 0f)
                {
                    this.m_Active = false;
                }
            }
            break;

        default:
            return;
        }
    }
Ejemplo n.º 6
0
    private void UpdateMovieWithFadeState()
    {
        switch (this.m_State)
        {
        case MovieWithFadeState.PreFadeOut:
        {
            Color color = this.m_FadeImage.color;
            color.a += Time.unscaledDeltaTime;
            this.m_FadeImage.color = color;
            this.m_FadeImage.gameObject.SetActive(true);
            if (color.a > 1f && !MainLevel.Instance.IsFadeIn() && !MainLevel.Instance.IsFadeOut() && FadeSystem.Get().GetFirstFadeIn())
            {
                MainLevel.Instance.Pause(true);
                MainLevel.Instance.UpdateTimeScale();
                this.SetState(MovieWithFadeState.Movie);
                return;
            }
            break;
        }

        case MovieWithFadeState.Movie:
            if (this.m_VideoPlayer.frame > 2L)
            {
                Color color2 = this.m_FadeImage.color;
                color2.a = 0f;
                this.m_FadeImage.color = color2;
                this.m_FadeImage.gameObject.SetActive(false);
            }
            if (this.m_VideoPlayer.isPlaying)
            {
                this.m_VideoJustStarted = false;
            }
            if (this.m_PlayingMovieClip != null && !this.m_VideoPlayer.isPlaying && !this.m_VideoJustStarted)
            {
                this.SetState(MovieWithFadeState.PostFadeOut);
                return;
            }
            break;

        case MovieWithFadeState.PostFadeOut:
        {
            Color color3 = this.m_FadeImage.color;
            color3.a += Time.unscaledDeltaTime;
            this.m_FadeImage.color = color3;
            this.m_FadeImage.gameObject.SetActive(true);
            if (color3.a > 1f)
            {
                this.StopMovieWithFade();
                this.SetState(MovieWithFadeState.PostFadeIn);
                return;
            }
            break;
        }

        case MovieWithFadeState.PostFadeIn:
        {
            Color color4 = this.m_FadeImage.color;
            if (Time.unscaledTime - this.m_PostFadeInStartTime > 0.3f)
            {
                color4.a -= Time.unscaledDeltaTime;
            }
            this.m_FadeImage.color = color4;
            if (color4.a < 0f)
            {
                this.SetState(MovieWithFadeState.None);
                this.m_FadeImage.gameObject.SetActive(false);
            }
            break;
        }

        default:
            return;
        }
    }
Ejemplo n.º 7
0
 public void WakeUp()
 {
     FadeSystem.Get().FadeOut(FadeType.All, new VDelegate(this.WakeUpOnFade), 1.5f, null);
 }
Ejemplo n.º 8
0
 private bool CanPlaySound()
 {
     return(!MainMenuManager.Get() || !MainMenuManager.Get().isActiveAndEnabled || (!FadeSystem.Get().m_FadingIn&& !FadeSystem.Get().m_FadingOut));
 }