Exemple #1
0
 public override void Update(AIShipController controller)
 {
     if (Vector3.Distance(controller.Ship.transform.position, _defendPosition) > 10f)
     {
         controller.Arrive(_defendPosition);
     }
     else
     {
         controller.SetHeading(_originalShipDirection);
     }
 }
Exemple #2
0
    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();
        }
    }