public override void Update() { if (Input.FirePrimary) { Weapon.Fire(Mathf.Deg2Rad * (Flip.Flipped ? 180f : 0f)); } if (Input.FireSecondary) { GranadeLauncher.Fire(Mathf.Deg2Rad * (Flip.Flipped ? 180f : 0f)); } if (Input.Left || Input.Right) { Set <Walk>(); return; } else { Movement.Stop(); } if (Input.Jump) { Set <Jump>(); return; } base.Update(); }
public override void Update() { if (Input.FirePrimary) { Weapon.Fire(Mathf.Deg2Rad * (Flip.Flipped ? 180f : 0f)); } if (Input.FireSecondary) { GranadeLauncher.Fire(Mathf.Deg2Rad * (Flip.Flipped ? 180f : 0f)); } if (Input.Left) { Movement.MoveLeft(); Flip.FlipLeft(); } else if (Input.Right) { Movement.MoveRight(); Flip.FlipRight(); } else { Movement.Stop(); } if (Surroundings.Down) { Set <Idle>(); return; } base.Update(); }