public override void SteerPhysics(BasicSteering controller) { JumpingGoblinSteering parentController = controller as JumpingGoblinSteering; Vector2 normal = Vector2.up; float angle = 0; angle = Vector2.Angle(parentController.transform.up, normal) * Mathf.Sign(parentController.transform.up.x - normal.x); angle = Utility.NormalizeAngle(angle); parentController.GetComponent<GoblinLocomotion>().KeepBalance(angle); if (controller.GetComponent<Rigidbody2D>().velocity.y < ParachuteOpenSpeed) { controller.SendMessage("Break", 4f); controller.SendMessage("ParachuteOpen"); } }
public override void ExitState(BasicSteering controller) { controller.SendMessage("ParachuteClose"); }