public override void StateUpdate() { if (FlyDragon.FaceDirect == Vector2.right) { FlyDragon.Move(Vector2.right); if (FlyDragon.TransformRoot.position.x >= WanderXLimit) { FlyDragon.Move(Vector2.left); } } if (FlyDragon.FaceDirect == Vector2.left) { FlyDragon.Move(Vector2.left); if (FlyDragon.TransformRoot.position.x <= -WanderXLimit) { FlyDragon.Move(Vector2.right); } } }
public override void StateUpdate() { FlyDragon.Move(MoveDirect); CheckHide(); }