public void AssignDroneToPlayer(GameObject _drone) { drone = _drone; shootingScript = drone.GetComponent <Shooting>(); flightScript = drone.GetComponent <flight>(); rayViewerScript = drone.GetComponent <RayViewer>(); }
void Start() { this._ray_viewer = this.GetComponent <RayViewer> (); this._my_render = this.GetComponent <MeshRenderer> (); var mats = GetComponent <Renderer>().materials; mats[1] = _off_material; GetComponent <Renderer>().materials = mats; }