//-------------------------------------------------- //-------------------------------------------------- void Start() //-------------------------------------------------- { lineRend = GetComponent <LineRenderer> (); simulationRoverManager = GetComponentInParent <SimulationRoverManager>(); roverCameraManager = simulationRoverManager.GetComponent <RoverCameraManager> (); }
//-------------------------------------------------- //-------------------------------------------------- private void Start() //-------------------------------------------------- { simulationRoverManager = GetComponentInParent <SimulationRoverManager>(); simulationManager = GameObject.Find("SimulationManager").GetComponent <SimulationManager>(); roverCameraManager = simulationRoverManager.GetComponent <RoverCameraManager>(); roverManagerList = simulationManager.GetRoverManagerList(); //grabbing colors from list of rovers for (int i = 0; i < roverManagerList.Count; i++) { roverColorsList.Add(roverManagerList[i].GetRoverColor()); } //setting alpha value of all colors in the list for (int i = 0; i < roverColorsList.Count; i++) { Color tempColor = roverColorsList[i]; tempColor.a = highLightAlpha; roverColorsList[i] = tempColor; } roverID = simulationRoverManager.GetRoverID(); roverHighlightColor = simulationRoverManager.GetRoverColor(); roverHighlightColor.a = highLightAlpha; lineRend = GetComponent <LineRenderer>(); lineRend.material.SetColor("_TintColor", roverHighlightColor); }