Ejemplo n.º 1
0
        public static void RunAutoUpdate()
        {
            //Debug.Log("PlayMaker AutoUpdater " + version);
            EditorApplication.update -= RunAutoUpdate;

            // we only want to run this once
            EditorStartupPrefs.ProjectUpdated(true);

            if (!CheckRequirements())
            {
                //Debug.Log("PlayMaker AutoUpdate: Could not auto-update.");
                return;
            }

            if (NeedsUpdate())
            {
                var updateMessage = "NOTE: ALWAYS BACKUP your project before updating PlayMaker or Unity!\n\nPlayMaker AutoUpdater would like to make these changes to the project:\n\n";
                foreach (var update in updateList)
                {
                    updateMessage += "- " + update + "\n";
                }
                updateMessage += "\n\nNOTE: You can run the AutoUpdater later from PlayMaker > Tools > Run AutoUpdater";
                if (EditorUtility.DisplayDialog("PlayMaker", updateMessage, "OK", "Cancel"))
                {
                    DoUpdate();
                }
            }

            // Fail silently so we don't spam user with "No UpdateTask Needed" dialogs
        }
        private static bool DoUnityVersionCheck()
        {
            if (!EditorStartupPrefs.IsUnityVersionCompatible())
            {
                DoFailedUnityVersionDialog();
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
 public static void Save()
 {
     if (!AssetDatabase.Contains(Instance))
     {
         var copy = CreateInstance <EditorStartupPrefs>();
         EditorUtility.CopySerialized(Instance, copy);
         instance = Resources.Load <EditorStartupPrefs>("EditorStartupPrefs");
         if (instance == null)
         {
             Debug.Log("Missing EditorStartupPrefs asset!");
             return;
         }
         EditorUtility.CopySerialized(copy, instance);
     }
     EditorUtility.SetDirty(Instance);
 }
Ejemplo n.º 4
0
        public static void Save()
        {
            if (!AssetDatabase.Contains(Instance))
            {
                var copy = CreateInstance <EditorStartupPrefs>();
                EditorUtility.CopySerialized(Instance, copy);
                instance = Resources.Load <EditorStartupPrefs>("EditorStartupPrefs");
                if (instance == null)
                {
                    AssetDatabase.CreateAsset(copy, "Assets/PlayMaker/Editor/Resources/EditorStartupPrefs.asset");
                    AssetDatabase.Refresh();
                    instance = copy;

                    //Debug.Log("Missing EditorStartupPrefs asset!");
                    return;
                }
                EditorUtility.CopySerialized(copy, instance);
            }
            EditorUtility.SetDirty(Instance);
        }
 public static void Save()
 {
     if (!AssetDatabase.Contains(Instance))
     {
         var copy = CreateInstance<EditorStartupPrefs>();
         EditorUtility.CopySerialized(Instance, copy);
         instance = Resources.Load<EditorStartupPrefs>("EditorStartupPrefs");
         if (instance == null)
         {
             Debug.Log("Missing EditorStartupPrefs asset!");
             return;
         }
         EditorUtility.CopySerialized(copy, instance);
     }
     EditorUtility.SetDirty(Instance);
 }