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)); } } } }
// Use this for initialization void Start () { scanner = GetComponent<LaserProjector>(); float sizeValue = 2f*Mathf.PI / theta_scale; size = (int)sizeValue; size++; lineRenderer = roboController.gameObject.AddComponent<LineRenderer>(); lineRenderer.material = new Material(Shader.Find("Particles/Additive")); lineRenderer.SetWidth(0.02f, 0.02f); //thickness of line lineRenderer.SetVertexCount(size); InvokeRepeating ("lookAround", 0.5f, .03f); }
// Use this for initialization void Start() { scanner = GetComponent <LaserProjector>(); float sizeValue = 2f * Mathf.PI / theta_scale; size = (int)sizeValue; size++; lineRenderer = roboController.gameObject.AddComponent <LineRenderer>(); lineRenderer.material = new Material(Shader.Find("Particles/Additive")); lineRenderer.SetWidth(0.02f, 0.02f); //thickness of line lineRenderer.SetVertexCount(size); InvokeRepeating("lookAround", 0.5f, .03f); }
public override void Start() { base.Start(); scanner = GetComponent<LaserProjector>(); }