Beispiel #1
0
    public override void stopExecution()
    {
        base.stopExecution();
        HoverJet jet = controller.GetComponentInChildren <HoverJet> ();

        if (jet != null)
        {
            jet.setAvailability(true);
            jet.setTarget(null);
        }
    }
Beispiel #2
0
    public override void execute()
    {
        base.execute();
        HoverJet jet = controller.GetComponentInChildren <HoverJet>();

        if (jet != null)
        {
            jet.setTarget(powerStation.labelHandle);
            jet.setAvailability(false);
        }
    }
Beispiel #3
0
    public override void execute()
    {
        base.execute();
        HoverJet jet = controller.GetComponentInChildren <HoverJet> ();

        if (jet != null)
        {
            jet.setTarget(dropPoint, true);
            jet.setAvailability(false);
        }
    }
Beispiel #4
0
    public override void execute()
    {
        base.execute();
        HoverJet jet = controller.GetComponentInChildren <HoverJet> ();

        if (jet != null)
        {
            currentDestination = getNearest(controller.transform.position);
            jet.setTarget(routePoints[currentDestination]);
            jet.setAvailability(false);
        }
    }
Beispiel #5
0
 public override void onMessage(RobotMessage message)
 {
     if (message.Message.Equals("target reached"))
     {
         HoverJet jet = controller.GetComponentInChildren <HoverJet> ();
         if (jet != null && routePoints[currentDestination] == message.Target)
         {
             ++currentDestination;
             if (currentDestination == routePoints.Count)
             {
                 currentDestination = 0;
             }
             if (routePoints[currentDestination] == null)
             {
                 Debug.LogWarning("Robot '" + controller.name + "' has detected a missing patrol route point. ");
                 Debug.LogWarning("Robot '" + controller.name + "' halted. ");
             }
             else
             {
                 jet.setTarget(routePoints[currentDestination]);
             }
         }
     }
 }