コード例 #1
0
    private void SetHealthBar()
    {
        if (IsClickDetected && !_lives.Ended())
        {
            var pushTime = Time.time - _startTime;

            PowerJumpBar.value = _gameCube.GetForces(pushTime);

            if (PowerJumpBar.value >= 300f)
            {
                _powerJumpFillImage.color = new Color(1f, 0, 0); // red;
            }
            else if (PowerJumpBar.value > 220f)
            {
                _powerJumpFillImage.color = new Color(1f, 0.5f, 0); // orange;
            }
            else if (PowerJumpBar.value >= 160f)
            {
                _powerJumpFillImage.color = new Color(0, 1f, 0); // green;
            }
            else if (PowerJumpBar.value < 160f)
            {
                _powerJumpFillImage.color = new Color(1f, 1f, 0); // yellow;
            }
        }
    }