private void Start() { if(GameObject.FindWithTag ("MultiplayerManager")) { players = GameObject.FindGameObjectsWithTag ("Player"); for(int i = 0; i < players.Length; i++) { if(players[i].GetComponent<NetworkIdentity>().isLocalPlayer) { m_Target = players[i].transform.FindChild ("CameraTarget"); } } } else { m_Target = GameObject.Find ("CameraTarget").transform; } targetRigidbody = m_Target.root.GetComponent<Rigidbody>(); carEngine = m_Target.root.GetComponent<CarEngine>(); carSetup = carEngine.GetComponent<CarSetup>(); radialBlur = GetComponent<CC_RadialBlur>(); if(GameObject.Find ("DriftManager")) { carDrifting = GameObject.Find ("DriftManager").GetComponent<CarDrifting>(); } }
void OnEnable() { Time.timeScale = PAUSED_TIME_SCALE; GameObject uiRoot = GameObject.Find("UI Root"); if(uiRoot!=null) { UICamera camera = uiRoot.GetComponentInChildren<UICamera>(); if(camera!=null) { camera.eventType = UICamera.EventType.UI_3D; cameraRef = camera; if(Application.loadedLevelName=="Garage") { blur = camera.GetComponent<CC_RadialBlur>(); if(blur==null) { blur = camera.gameObject.AddComponent<CC_RadialBlur>(); } blur.enabled = true; /* analogTV = camera.GetComponent<CC_AnalogTV>(); if(analogTV==null) { analogTV = camera.gameObject.AddComponent<CC_AnalogTV>(); }*/ //analogTV.enabled = true; } } } }
void Awake() { myRenderer = GetComponent<Renderer>(); blurEffect = transform.parent.GetComponentInChildren<CC_RadialBlur>(); howlClip = GetComponent<AudioSource>(); }