示例#1
0
    private void HandleTurret(float turretAction)
    {
        int index = Mathf.FloorToInt(turretAction);

        switch (index)
        {
        case 0:
            tankShooting.AddTurn(-1);
            break;

        case 1:
            tankShooting.AddTurn(1);
            break;

        case 2:
            tankShooting.Fire(true, this);
            break;
        }
    }
示例#2
0
    private void RotateTurret(float amount)
    {
        float rotation = Mathf.Clamp(amount, -1, 1);

        tankShooting.AddTurn(rotation);
    }