void AddRenderEventCall() { foreach (Camera cam in Camera.allCameras) { NsRenderManager nsr = cam.GetComponent <NsRenderManager>(); if (nsr == null) { nsr = cam.gameObject.AddComponent <NsRenderManager>(); } nsr.AddRenderEventCall(this); } }
void AddRenderEventCall() { for (int i = 0; i < Camera.allCameras.Length; ++i) { NsRenderManager nsr = Camera.allCameras[i].GetComponent <NsRenderManager>(); if (nsr == null) { nsr = Camera.allCameras[i].gameObject.AddComponent <NsRenderManager>(); } nsr.AddRenderEventCall(this); } }
private void AddRenderEventCall() { Camera[] allCameras = Camera.allCameras; for (int i = 0; i < allCameras.Length; i++) { Camera camera = allCameras[i]; NsRenderManager nsRenderManager = camera.GetComponent <NsRenderManager>(); if (nsRenderManager == null) { nsRenderManager = camera.gameObject.AddComponent <NsRenderManager>(); } nsRenderManager.AddRenderEventCall(this); } }
void AddRenderEventCall() { //foreach (Camera cam in Camera.allCameras) //{ NsRenderManager nsr = Camera.main.GetComponent <NsRenderManager>(); if (nsr == null) { nsr = Camera.main.gameObject.AddComponent <NsRenderManager>(); } nsr.AddRenderEventCall(this); #if UNITY_ANDROID && !UNITY_EDITOR //在Android下关闭 nsr.enabled = false; #endif //} }