예제 #1
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
    }
예제 #2
0
    public void SetAlpha(float _value)
    {
        alpha = _value;

        alpha = Mathf.Clamp01(alpha);

        if (alpha == 0)
        {
            alphaStatus = HUDAlphaStat.Zero;
        }
        else
        {
            if (alpha == 1)
            {
                alphaStatus = HUDAlphaStat.Full;
            }
            else
            {
                alphaStatus = HUDAlphaStat.Mid;
            }
        }
    }
예제 #3
0
    public void StartIncreasingAlpha(float _speed)
    {
        alphaChangeSpeed = _speed;

        alphaStatus = HUDAlphaStat.Increasing;
    }