void AttachRemoteComponent() { if (cameraToStream != null) { if (cameraToStream.gameObject.GetComponent <RemoteScreenComponent>() == null) { m_remoteScreenComponent = cameraToStream.gameObject.AddComponent <RemoteScreenComponent>(); } else { m_remoteScreenComponent = cameraToStream.gameObject.GetComponent <RemoteScreenComponent>(); } m_remoteScreenComponent.WaitOnFrame = m_waitOnFrame; if (!string.IsNullOrEmpty(selectedConfiguration) && m_configurations.Length > 0) { int findIndex = 0; for (int i = 0; i < m_configurationsNames.Length; i++) { if (m_configurationsNames[i].IndexOf(selectedConfiguration) != -1) { findIndex = i; break; } } var path = AssetDatabase.GUIDToAssetPath(m_configurations[findIndex]); var config = AssetDatabase.LoadAssetAtPath <RemoteScreenConfiguration>(path); config.Initialize(m_remoteScreenComponent); } else if (m_remoteScreenConfiguration != null) { m_remoteScreenConfiguration.Initialize(m_remoteScreenComponent); } m_remoteScreenComponent.ProcessImage = (FrameInfo frameInfo, Action callback) => { m_dataSender.SendScreen(frameInfo, streamingConnectionProvider, callback); }; m_remoteScreenComponent.CanProcessImages = () => { return(EditorDataSender.frameIds.Count > 0); }; cameraToStream.gameObject.GetComponent <RemoteScreenComponent>().Reset(); } }
public virtual void Initialize(RemoteScreenComponent rm) { }