void ShowStopSyncButton() { if (GUILayout.Button("Stop D2E Sync!")) { EditorSync.StopSync(); m_kSyncObjects.Clear(); } }
void ShowStopControlButton() { if (GUILayout.Button("Stop E2D Control!")) { EditorSync.StopControl(); m_kControlObjects.Clear(); } }
void Awake() { m_kInstance = this; DontDestroyOnLoad(gameObject); #if UNITY_EDITOR EditorSync.Init(); #else DeviceSync.Init(); #endif }
public override void OnInspectorGUI() { SerializedProperty iFrameRate = serializedObject.FindProperty("m_iSyncFrameRate"); SerializedProperty kActivity = serializedObject.FindProperty("m_kAndroidActivity"); SerializedProperty bWireless = serializedObject.FindProperty("m_bWirelessConnection"); SerializedProperty kDeviceIP = serializedObject.FindProperty("m_kDeviceIPAddress"); serializedObject.Update(); EditorGUILayout.PropertyField(iFrameRate); if (EditorApplication.isPlaying) { if (SyncManager.SyncSceneID != -1) { if (GUILayout.Button("Update Sync Frame Rate")) { SyncManager.SyncFrameRate = iFrameRate.intValue; EditorSync.UpdateSyncFrameRate(); } } else { if (GUILayout.Button("Request Sync Scene!")) { SyncManager.SyncFrameRate = iFrameRate.intValue; EditorSync.StartSync(); EditorWindow.GetWindow(typeof(SyncControllWindow)); } } } else { EditorGUILayout.PropertyField(kActivity); if (GUILayout.Button("Start Android Activity")) { StartAndroidApp(kActivity.stringValue); } EditorGUILayout.PropertyField(bWireless); if (bWireless.boolValue) { EditorGUILayout.PropertyField(kDeviceIP); if (GUILayout.Button("Connect Device")) { ConnectDeviceIP(kDeviceIP.stringValue); } } if (GUILayout.Button("ADB Devices")) { EditorLoader.RunAdbCommand(@" devices", true); } } serializedObject.ApplyModifiedProperties(); }
IEnumerator UpdateLogic() { while (true) { yield return(wt); yield return(wfeof); #if UNITY_EDITOR EditorSync.UpdateLogic(); #else DeviceSync.UpdateLogic(); #endif } }
public static void StartE2DControl(byte[] data) { EditorSync.SendControlRequest(data); }
public static void StartD2ESync(byte[] data) { //Debug.Log(data.Length); EditorSync.SendSyncRequest(data); }