Exemple #1
0
        public static void ChangePlatform(BuildTarget desiredPlatform)
        {
            if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
            {
                // They hit cancel in the save dialog
                return;
            }

            if (ProjenyEditorUtil.GetPlatformFromDirectoryName() == desiredPlatform)
            {
                UnityEngine.Debug.Log("Projeny: Already at the desired platform, no need to change project.");
                return;
            }

            var result = PrjInterface.RunPrj(PrjInterface.CreatePrjRequestForPlatform("updateLinks", desiredPlatform));

            if (result.Succeeded)
            {
                result = PrjInterface.RunPrj(PrjInterface.CreatePrjRequestForPlatform("openUnity", desiredPlatform));
            }

            if (result.Succeeded)
            {
                EditorApplication.Exit(0);
            }
            else
            {
                DisplayPrjError(
                    "Changing platform to '{0}'"
                    .Fmt(desiredPlatform.ToString()), result.ErrorMessage);
            }
        }
Exemple #2
0
        public static void ChangeProject(string projectName)
        {
            if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
            {
                // They hit cancel in the save dialog
                return;
            }

            var result = PrjInterface.RunPrj(PrjInterface.CreatePrjRequestForProject("updateLinks", projectName));

            if (result.Succeeded)
            {
                result = PrjInterface.RunPrj(PrjInterface.CreatePrjRequestForProject("openUnity", projectName));

                if (result.Succeeded)
                {
                    EditorApplication.Exit(0);
                }
            }

            if (!result.Succeeded)
            {
                DisplayPrjError(
                    "Changing project to '{0}'"
                    .Fmt(projectName), result.ErrorMessage);
            }
        }
Exemple #3
0
        public static void OpenCustomSolution()
        {
            UpdateCustomSolution();

            var response = PrjInterface.RunPrj(PrjInterface.CreatePrjRequest("openCustomSolution"));

            if (!response.Succeeded)
            {
                PrjHelper.DisplayPrjError(
                    "Opening C# Project", response.ErrorMessage);
            }
        }
Exemple #4
0
        static PrjPathVars()
        {
            var response = PrjInterface.RunPrj(PrjInterface.CreatePrjRequest("getPathVars"));

            if (response.Succeeded)
            {
                _varMap = YamlSerializer.Deserialize <Dictionary <string, string> >(response.Output);
            }
            else
            {
                PrjHelper.DisplayPrjError("Initializing Path Vars", response.ErrorMessage);
            }
        }
Exemple #5
0
        public static bool UpdateLinks()
        {
            var result = PrjInterface.RunPrj(PrjInterface.CreatePrjRequest("updateLinks"));

            AssetDatabase.Refresh();

            if (!result.Succeeded)
            {
                DisplayPrjError("Updating directory links", result.ErrorMessage);
                return(false);
            }

            return(true);
        }
Exemple #6
0
        public static bool UpdateLinks()
        {
            var result = PrjInterface.RunPrj(PrjInterface.CreatePrjRequest("updateLinks"));

            // This sometimes causes out of memory issues for reasons unknown so just let user
            // manually refresh
            //AssetDatabase.Refresh();

            if (!result.Succeeded)
            {
                DisplayPrjError("Updating directory links", result.ErrorMessage);
                return(false);
            }

            return(true);
        }
Exemple #7
0
        public static void UpdateCustomSolution()
        {
            // Need the unity solution for defines and references
            ProjenyEditorUtil.ForceGenerateUnitySolution();

            var response = PrjInterface.RunPrj(PrjInterface.CreatePrjRequest("updateCustomSolution"));

            if (response.Succeeded)
            {
                Log.Info("Projeny: Custom solution has been updated");
            }
            else
            {
                PrjHelper.DisplayPrjError(
                    "Updating C# Project", response.ErrorMessage);
            }
        }