Beispiel #1
0
        public static void SyncSolution(bool sendProjectChangeRequest = true)
        {
            var lockFile = PathManager.GetSyncSolutionLockFile();

            try
            {
                if (File.Exists(lockFile))
                {
                    return;
                }

                File.WriteAllText(lockFile, "");
                ClearSolution();
                System.Type T = System.Type.GetType("UnityEditor.SyncVS,UnityEditor");
                System.Reflection.MethodInfo SyncSolution = T.GetMethod("SyncSolution", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
                SyncSolution.Invoke(null, null);

                if (!sendProjectChangeRequest)
                {
                    File.Delete(lockFile);
                    return;
                }

                SendSyncProjectRequests();
                File.Delete(lockFile);
            }
            catch (System.Exception e)
            {
                if (File.Exists(lockFile))
                {
                    File.Delete(lockFile);
                }
                Debug.LogWarning(e);
            }
        }