Ejemplo n.º 1
0
 public static PrjRequest CreatePrjRequest(string requestId)
 {
     return(CreatePrjRequestForProjectAndPlatform(
                requestId,
                ProjenyEditorUtil.GetCurrentProjectName(),
                ProjenyEditorUtil.GetPlatformFromDirectoryName()));
 }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
0
        public static void ChangeProject(string projectName, string platformName = "windows")
        {
            if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
            {
                // They hit cancel in the save dialog
                return;
            }
            var platform = ProjenyEditorUtil.FromPlatformDirStr(platformName);

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

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

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

            if (!result.Succeeded)
            {
                DisplayPrjError(
                    "Changing project to '{0}'"
                    .Fmt(projectName), result.ErrorMessage);
            }
        }
Ejemplo n.º 4
0
 public static PrjRequest CreatePrjRequestForPlatform(
     string requestId, BuildTarget platform)
 {
     return(CreatePrjRequestForProjectAndPlatform(
                requestId,
                ProjenyEditorUtil.GetCurrentProjectName(),
                platform));
 }
Ejemplo n.º 5
0
 public static PrjRequest CreatePrjRequestForProject(
     string requestId, string project)
 {
     return(CreatePrjRequestForProjectAndPlatform(
                requestId,
                project,
                ProjenyEditorUtil.GetPlatformFromDirectoryName()));
 }
Ejemplo n.º 6
0
        public static IEnumerator UpdateCustomSolutionAsync()
        {
            // Need the unity solution for defines and references
            ProjenyEditorUtil.ForceGenerateUnitySolution();

            var runner = PrjInterface.RunPrjAsync(PrjInterface.CreatePrjRequest("updateCustomSolution"));

            while (runner.MoveNext() && !(runner.Current is PrjResponse))
            {
                yield return(runner.Current);
            }

            yield return(CreateStandardResponse((PrjResponse)runner.Current));
        }
Ejemplo n.º 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);
            }
        }