Beispiel #1
0
 void ShowStopSyncButton()
 {
     if (GUILayout.Button("Stop D2E Sync!"))
     {
         EditorSync.StopSync();
         m_kSyncObjects.Clear();
     }
 }
Beispiel #2
0
 void ShowStopControlButton()
 {
     if (GUILayout.Button("Stop E2D Control!"))
     {
         EditorSync.StopControl();
         m_kControlObjects.Clear();
     }
 }
Beispiel #3
0
        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();
        }
Beispiel #5
0
        IEnumerator UpdateLogic()
        {
            while (true)
            {
                yield return(wt);

                yield return(wfeof);

#if UNITY_EDITOR
                EditorSync.UpdateLogic();
#else
                DeviceSync.UpdateLogic();
#endif
            }
        }
Beispiel #6
0
 public static void StartE2DControl(byte[] data)
 {
     EditorSync.SendControlRequest(data);
 }
Beispiel #7
0
 public static void StartD2ESync(byte[] data)
 {
     //Debug.Log(data.Length);
     EditorSync.SendSyncRequest(data);
 }