Exemplo n.º 1
0
    public override bool canExecute()
    {
        RobotArms arms = controller.GetComponentInChildren <RobotArms>();
        RoboEyes  eyes = controller.GetComponentInChildren <RoboEyes>();

        return(eyes != null && eyes.hasScanner() && arms != null && arms.hasTarget());
    }
Exemplo n.º 2
0
 public override void onMessage(RobotMessage message)
 {
     if (message.Type == RobotMessage.MessageType.ACTION)
     {
         if (message.Message.Equals("target reached"))
         {
             LaserProjector projector = scanStation.label.GetComponentInChildren <LaserProjector>();
             if (projector != null)
             {
                 projector.setController(controller);
                 projector.startScan();
             }
             //RobotArms arms = controller.GetComponentInChildren<RobotArms>();
             //arms.dropTarget();
         }
         else if (message.Message.Equals("target scanned"))
         {
             List <Goal> goals = new List <Goal>();
             goals.Add(new Goal(GoalEnum.Offense, 10f));
             RobotArms arms   = controller.GetComponentInChildren <RobotArms>();
             Label     target = arms.getTarget();
             if (target.GetComponent <Player>() != null)
             {
                 controller.addEndeavour(new ElectrocuteAction(controller, goals, target));
             }
         }
     }
 }
Exemplo n.º 3
0
    public override bool canExecute()
    {
        HoverJet  jet  = controller.GetComponentInChildren <HoverJet> ();
        RobotArms arms = controller.GetComponentInChildren <RobotArms>();

        return(arms != null && !arms.hasTarget() && !target.hasTag(TagEnum.Grabbed) && controller.knowsTarget(target.labelHandle) && jet != null && jet.canReach(target));
    }
Exemplo n.º 4
0
 public override void onMessage(RobotMessage message)
 {
     if (message.Message.Equals("target reached"))
     {
         RobotArms arms = controller.GetComponentInChildren <RobotArms> ();
         arms.dropTarget();
     }
 }
Exemplo n.º 5
0
    public override void execute()
    {
        base.execute();
        RobotArms arms = controller.GetComponentInChildren <RobotArms>();

        if (arms != null)
        {
            arms.electrifyTarget();
        }
    }
Exemplo n.º 6
0
    public override void stopExecution()
    {
        base.stopExecution();
        RobotArms arms = controller.GetComponentInChildren <RobotArms> ();

        if (arms != null)
        {
            arms.setAvailability(true);
            arms.dropTarget();
        }
    }
Exemplo n.º 7
0
    public override void execute()
    {
        base.execute();
        RobotArms arms = controller.GetComponentInChildren <RobotArms> ();

        if (arms != null)
        {
            arms.attachTarget(target);
            arms.setAvailability(false);
        }
    }
Exemplo n.º 8
0
    void Start()
    {
        jet = GetComponentInChildren<HoverJet>();
        arms = GetComponentInChildren<RobotArms>();
        agent = GetComponentInChildren<NavMeshAgent>();

        MeshRenderer gameObjectRenderer = GetComponent<MeshRenderer>();
        original = gameObjectRenderer.material;
        foreach (RobotInterest location in locations) {
            sightingFound(location);
            trackedTargets.Add(location);
        }
    }
Exemplo n.º 9
0
    public override bool isStale()
    {
        RobotArms arms = controller.GetComponentInChildren <RobotArms>();

        return(target == null || arms == null || (arms.getProposedTarget() != target && !arms.hasTarget()));
    }
Exemplo n.º 10
0
    public override bool canExecute()
    {
        RobotArms arms = controller.GetComponentInChildren <RobotArms> ();

        return((arms != null) && (dropPoint != null) && (arms.hasTarget()));
    }