/** * Sets everything up and starts discovery on the native extension. */ private void Activate() { Debug.Log("Activating Cast Remote Display."); if (CastRemoteDisplayManager == null) { Debug.LogError("FATAL: CastRemoteDisplayManager script not found."); return; } if (CastRemoteDisplayManager.CastAppId == null || CastRemoteDisplayManager.CastAppId.Equals("")) { Debug.LogError("FATAL: CastRemoteDisplayManager needs a CastAppId"); return; } if (CastRemoteDisplayManager.Configuration == null) { Debug.LogError("FATAL: CastRemoteDisplayManager has null configuration"); return; } #if UNITY_ANDROID && !UNITY_EDITOR castRemoteDisplayExtension = new CastRemoteDisplayAndroidExtension(this); #elif UNITY_IOS && !UNITY_EDITOR castRemoteDisplayExtension = new CastRemoteDisplayiOSExtension(this); #elif UNITY_EDITOR CastRemoteDisplaySimulator displaySimulator = UnityEngine.Object.FindObjectOfType <CastRemoteDisplaySimulator>(); if (displaySimulator) { castRemoteDisplayExtension = new CastRemoteDisplayUnityExtension(this, displaySimulator); } #endif if (castRemoteDisplayExtension != null) { castRemoteDisplayExtension.Activate(); #if !UNITY_IOS && !UNITY_EDITOR // Non iOS platforms can render using RenderRemoteDisplayCoroutine. StartCoroutine(RenderRemoteDisplayCoroutine()); #endif // Update the list of cast devices in case we missed updates from the native lib while this // object was deactivated. UpdateCastDevicesFromNativeCode(); } else { Debug.LogWarning("Disabling the CastRemoteDisplayManager because the platform is not " + "Android or iOS, and no simulator is found."); } }
/** * Terminates the current remote display session (if any) and stops discovery on the native * extension. */ private void Deactivate() { Debug.Log("Deactivating Cast Remote Display."); StopRemoteDisplaySession(); if (castRemoteDisplayExtension != null) { castRemoteDisplayExtension.Deactivate(); } castRemoteDisplayExtension = null; StopAllCoroutines(); castDevices.Clear(); }
/** * Terminates the current remote display session (if any) and stops discovery on the native * extension. */ private void Deactivate() { Debug.Log("Deactivating Cast Remote Display."); connectedCastDevice = null; isCasting = false; StopRemoteDisplaySession(); DiscardGeneratedTextureIfNeeded(); if (castRemoteDisplayExtension != null) { castRemoteDisplayExtension.Deactivate(); } castRemoteDisplayExtension = null; StopAllCoroutines(); castDevices.Clear(); }
/** * Terminates the current remote display session (if any) and stops discovery on the native * extension. */ private void Deactivate() { Debug.Log("Deactivating Cast Remote Display."); StopRemoteDisplaySession(); if (castRemoteDisplayExtension != null) { castRemoteDisplayExtension.Deactivate(); } castRemoteDisplayExtension = null; StopAllCoroutines(); castDevices.Clear(); }
/** * Sets everything up and starts discovery on the native extension. */ private void Activate() { Debug.Log("Activating Cast Remote Display."); if (CastRemoteDisplayManager == null) { Debug.LogError("FATAL: CastRemoteDisplayManager script not found."); return; } if (CastRemoteDisplayManager.CastAppId == null || CastRemoteDisplayManager.CastAppId.Equals("")) { Debug.LogError("FATAL: CastRemoteDisplayManager needs a CastAppId"); return; } if (CastRemoteDisplayManager.Configuration == null) { Debug.LogError("FATAL: CastRemoteDisplayManager has null configuration"); return; } #if UNITY_ANDROID && !UNITY_EDITOR castRemoteDisplayExtension = new CastRemoteDisplayAndroidExtension(this); #elif UNITY_IOS && !UNITY_EDITOR castRemoteDisplayExtension = new CastRemoteDisplayiOSExtension(this); #elif UNITY_EDITOR CastRemoteDisplaySimulator displaySimulator = UnityEngine.Object.FindObjectOfType<CastRemoteDisplaySimulator>(); if (displaySimulator) { castRemoteDisplayExtension = new CastRemoteDisplayUnityExtension(this, displaySimulator); } #endif if (castRemoteDisplayExtension != null) { castRemoteDisplayExtension.Activate(); #if !UNITY_IOS && !UNITY_EDITOR // Non iOS platforms can render using RenderRemoteDisplayCoroutine. StartCoroutine(RenderRemoteDisplayCoroutine()); #endif // Update the list of cast devices in case we missed updates from the native lib while this // object was deactivated. UpdateCastDevicesFromNativeCode(); } else { Debug.LogWarning("Disabling the CastRemoteDisplayManager because the platform is not " + "Android or iOS, and no simulator is found."); } }
/** * Terminates the current remote display session (if any) and stops discovery on the native * extension. */ private void Deactivate() { Debug.Log("Deactivating Cast Remote Display."); connectedCastDevice = null; isCasting = false; StopRemoteDisplaySession(); DiscardGeneratedTextureIfNeeded(); if (castRemoteDisplayExtension != null) { castRemoteDisplayExtension.Deactivate(); } castRemoteDisplayExtension = null; StopAllCoroutines(); castDevices.Clear(); }