private void CollideBird() { movement.Jump(upSpeed); var acce = ItemManager.Instance.GetItemImpact("Star") * 2; movement.Accelerate(acce); }
//tem que ser update porque mexe com a física do player void FixedUpdate() { var vertical = Input.GetAxisRaw("Vertical"); if (vertical > 0) { pm.Accelerate(); } else if (vertical < 0) { pm.Reverse(); } var horizontal = Input.GetAxisRaw("Horizontal"); if (horizontal < 0) { pm.StrafeToLeft(); } else if (horizontal > 0) { pm.StrafeToRight(); } var roll = Input.GetAxis("Roll"); if (roll > 0) { ma.RollRight(); } else if (roll < 0) { ma.RollLeft(); } var fire = Input.GetAxisRaw("Fire"); if (fire > 0) { pw.Shoot(); } }
void Update() { if (canPassInput) { if (UnityEngine.Input.GetKey(KeyCode.UpArrow)) { playerMovement.Accelerate(); } if (UnityEngine.Input.GetKey(KeyCode.LeftArrow)) { playerMovement.Turn(false); } if (UnityEngine.Input.GetKey(KeyCode.RightArrow)) { playerMovement.Turn(true); } if (UnityEngine.Input.GetKeyDown(KeyCode.Space)) { playerShooting.Shoot(); } } }