void Initialize() { scrPlayer = transform.root.GetComponent <ScrPlayer>(); if (scrPlayer == null) { Debug.LogError("Transform Root of the player object must have ScrPlayer component."); return; } renderers = new Renderer[0]; if (!includeChildren) { renderers = new Renderer[1]; renderers[0] = GetComponent <Renderer>(); } else { renderers = GetComponentsInChildren <Renderer>(); } Camera.onPreCull += SwitchRender; initialized = true; }
void Initialize() { scrPlayer = transform.root.GetComponent <ScrPlayer>(); viewport.camera = GetComponent <Camera>(); if (scrPlayer == null) { Debug.LogError("Transform Root of the player object must have ScrPlayer component."); return; } DsLib.PlayerManager.AddViewportEntry(scrPlayer.playerId, viewport); initialized = true; }