public override void Update(AIShipController controller) { if (controller.Ship.rigidbody.velocity.magnitude > 0 || controller.Ship.rigidbody.velocity.magnitude < 0) { controller.Stop(); } }
public override void Update(AIShipController controller) { if (movementLocationIndicator == null) { movementLocationIndicator = (GameObject)GameObject.Instantiate(controller.movementLocationIndicatorPrefab, moveToPosition, Quaternion.identity); } if (!hasArrived) { controller.Arrive(moveToPosition); if (Vector3.Distance(controller.Ship.transform.position, moveToPosition) < 1) { hasArrived = true; } } else { controller.Stop(); } }