public override void Update() { if (Input.FirePrimary) { Set(_attackType); return; } if (Input.Jump) { Set <Jump>(); return; } if (Input.Left) { Movement.MoveLeft(); Flip.FlipLeft(); } else if (Input.Right) { Movement.MoveRight(); Flip.FlipRight(); } else { Movement.Stop(); Set <Idle>(); 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.Jump) { Set <Jump>(); return; } if (Input.Left) { Movement.MoveLeft(); Flip.FlipLeft(); } else if (Input.Right) { Movement.MoveRight(); Flip.FlipRight(); } else { Movement.Stop(); Set <Idle>(); return; } base.Update(); }