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; } }
private void RotateTurret(float amount) { float rotation = Mathf.Clamp(amount, -1, 1); tankShooting.AddTurn(rotation); }