Exemplo n.º 1
0
 public void ShowForAWhile(float _duration, float _startAlphaSpeed, float _endAlphaSpeed)
 {
     showForAWhile_Step = ShowForAWhileStep.FirstAlpha;
     showForAWhile_StartingAlphaSpeed = _startAlphaSpeed;
     showForAWhile_EndAlphaSpeed      = _endAlphaSpeed;
     showForAWhile_DurationCounter    = _duration;
 }
Exemplo n.º 2
0
    //

    void Update()
    {
        #region Show For A While
        if (showForAWhile_Step == ShowForAWhileStep.FirstAlpha)
        {
            StartIncreasingAlpha(showForAWhile_StartingAlphaSpeed);
            showForAWhile_Step = ShowForAWhileStep.Showing;
        }

        if (showForAWhile_Step == ShowForAWhileStep.Showing)
        {
            showForAWhile_DurationCounter = MathfPlus.DecByDeltatimeToZero(showForAWhile_DurationCounter);

            if (showForAWhile_DurationCounter == 0)
            {
                StartDecreasingAlpha(showForAWhile_EndAlphaSpeed);
                showForAWhile_Step = ShowForAWhileStep.EndAlpha;
            }
        }

        if (showForAWhile_Step == ShowForAWhileStep.EndAlpha)
        {
            if (alpha == 0)
            {
                showForAWhile_Step = ShowForAWhileStep.Idle;
            }
        }
        #endregion

        #region Alpha
        if (alphaStatus == HUDAlphaStat.Increasing)
        {
            SetAlpha(alpha + alphaChangeSpeed * Time.deltaTime);

            if (alphaStatus == HUDAlphaStat.Mid)
            {
                alphaStatus = HUDAlphaStat.Increasing;
            }
        }

        if (alphaStatus == HUDAlphaStat.Decreasing)
        {
            SetAlpha(alpha - alphaChangeSpeed * Time.deltaTime);

            if (alphaStatus == HUDAlphaStat.Mid)
            {
                alphaStatus = HUDAlphaStat.Decreasing;
            }
        }
        #endregion
    }