public void Rotate(float rotationInput) { float input = Mathf.Abs(rotationInput); ObjectSelfDirection direction = ObjectSelfDirection.RIGHT; if (rotationInput < 0.1f) { direction = ObjectSelfDirection.LEFT; } rotationCtrl.Rotate(direction, input); }
//Every block has OnTriggerEnter method, which triggers on player, //We want to wait for physics to work, disable blocks and rotate player 90 degrees. Repeat with all gate "prefabs" we have IEnumerator ExcludeBlocksFromGates() { for (int i = 0; i < _gates.Count; i++) { _gates[i].gameObject.SetActive(true); yield return(new WaitForFixedUpdate()); _gates[i].BlocksArePrepared(); _gates[i].gameObject.SetActive(false); _player.Rotate(-90); } CreateObjectPoolsForGates(); }
void Update() { // Stop if we aren't the local player // We don't want to move all the tanks if (!isLocalPlayer) { return; } // Read the input hMotion = (sbyte)Input.GetAxisRaw("Horizontal"); vMotion = (sbyte)Input.GetAxisRaw("Vertical"); mousePos = Input.mousePosition; // Pass it to the controllers tankCtrl.Move(hMotion, vMotion); turretCtrl.Rotate(mousePos); if (Input.GetAxis("Fire1") > 0) { weaponCtrl.Shoot(); } }
void Update() { rotator.Rotate(); ManageShooting(); }
public void Rotate(Vector3 amount) { rotatable.Rotate(amount); }
public static async Task ApplyAndAddRotation(IRotation rotation, ICollection<IRotation> rotations, IRotatable configuration) { if (rotation == null) return; rotations.Add(rotation); var cubeRotation = rotation as CubeRotation; var faceRotation = rotation as FaceRotation; if (cubeRotation != null) { await configuration.RotateCube(cubeRotation).ConfigureAwait(false); } if (faceRotation != null) { await configuration.Rotate(faceRotation).ConfigureAwait(false); } }