public override bool canExecute() { RobotArms arms = controller.GetComponentInChildren <RobotArms>(); RoboEyes eyes = controller.GetComponentInChildren <RoboEyes>(); return(eyes != null && eyes.hasScanner() && arms != null && arms.hasTarget()); }
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)); } } } }
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)); }
public override void onMessage(RobotMessage message) { if (message.Message.Equals("target reached")) { RobotArms arms = controller.GetComponentInChildren <RobotArms> (); arms.dropTarget(); } }
public override void execute() { base.execute(); RobotArms arms = controller.GetComponentInChildren <RobotArms>(); if (arms != null) { arms.electrifyTarget(); } }
public override void stopExecution() { base.stopExecution(); RobotArms arms = controller.GetComponentInChildren <RobotArms> (); if (arms != null) { arms.setAvailability(true); arms.dropTarget(); } }
public override void execute() { base.execute(); RobotArms arms = controller.GetComponentInChildren <RobotArms> (); if (arms != null) { arms.attachTarget(target); arms.setAvailability(false); } }
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); } }
public override bool isStale() { RobotArms arms = controller.GetComponentInChildren <RobotArms>(); return(target == null || arms == null || (arms.getProposedTarget() != target && !arms.hasTarget())); }
public override bool canExecute() { RobotArms arms = controller.GetComponentInChildren <RobotArms> (); return((arms != null) && (dropPoint != null) && (arms.hasTarget())); }