コード例 #1
0
ファイル: Game.cs プロジェクト: philiplin0708/SkeeBallGame
    void UpdateBar()
    {
        if (!powerBar.enabled)
        {
            return;
        }

        switch (barMovement)
        {
        case BarMovement.ToLeft:
            barFillAmount -= (barMoveSpeed * Time.fixedDeltaTime);
            break;

        case BarMovement.ToRight:
            barFillAmount += (barMoveSpeed * Time.fixedDeltaTime) - (barFillAmount * barMoveSpeed / 50);
            break;
        }

        if (barFillAmount >= .9f && barMovement == BarMovement.ToRight)
        {
            barMovement = BarMovement.ToLeft;
        }
        else
        if (barFillAmount <= .1 && barMovement == BarMovement.ToLeft)
        {
            barMovement = BarMovement.ToRight;
        }

        powerBar.GetComponent <Image>().fillAmount = barFillAmount;
    }
コード例 #2
0
ファイル: Game.cs プロジェクト: philiplin0708/SkeeBallGame
 void ShowPowerBar()
 {
     barMovement   = BarMovement.ToRight;
     barFillAmount = 0;
     powerBar.GetComponent <Image>().fillAmount = barFillAmount;
     barBG.enabled    = true;
     powerBar.enabled = true;
 }
コード例 #3
0
    private void changeSpeed(BarMovement spawnedObstacleMovement)
    {
        float lastBarSpeed = SpawnManager.Get().BarSpeed;

        if (GameManager.Get().IsGameOver())
        {
            spawnedObstacleMovement.Speed = lastBarSpeed;
            return;
        }

        if (ScoreManager.Instance.GetCurrentLevel() % 2 == 0)
        {
            spawnedObstacleMovement.Speed = lastBarSpeed;
            return;
        }

        SpawnManager.Get().BarSpeed = spawnedObstacleMovement.Speed + (ScoreManager.Instance.GetCurrentLevel() * barScoreLeveleMultiplier);

        lastBarSpeed = SpawnManager.Get().BarSpeed;

        spawnedObstacleMovement.Speed = lastBarSpeed;
    }