// Use this for initialization void Start() { #if UNITY_STANDALONE_WIN || UNITY_EDITOR webRtcCore = new WebRtcCoreWindows(); #elif UNITY_IOS webRtcCore = new WebRtcCoreiOS(); #endif webRtcCore.MsgExchanger = WebRtcMsgExchanger.GetComponent <WebRtcMsgExchanger>(); foreach (GameObject tage in RenderingTargets) { tage.GetComponent <Renderer>().material.mainTexture = webRtcCore.ReceivedVideoFrame.texture2D; } }
// Use this for initialization void Start() { #if UNITY_STANDALONE_WIN || UNITY_EDITOR webRtcCore = new WebRtcCoreWindows(StreamSize.width, StreamSize.height); desktopTexture = new Texture2D(StreamSize.width, StreamSize.height, TextureFormat.RGBA32, false); Win32Api.BeginDesktopCapture(StreamSize.width, StreamSize.height); #elif UNITY_IPHONE webRtcCore = new WebRtcCoreiOS(StreamSize.width, StreamSize.height); #endif webRtcCore.MsgExchanger = webRtcMsgExchanger; foreach (GameObject tage in RenderingTargets) { tage.GetComponent <Renderer>().material.mainTexture = webRtcCore.ReceivedTexture2D; } }