static void LoadPrefs()
    {
        _faceColor = pb_Preferences_Internal.GetColor(pb_Constant.pbDefaultFaceColor);

        pbDefaultSelectedVertexColor = pb_Preferences_Internal.GetColor(pb_Constant.pbDefaultSelectedVertexColor);
        pbDefaultVertexColor         = pb_Preferences_Internal.GetColor(pb_Constant.pbDefaultVertexColor);

        if (!EditorPrefs.HasKey(pb_Constant.pbDefaultOpenInDockableWindow))
        {
            EditorPrefs.SetBool(pb_Constant.pbDefaultOpenInDockableWindow, true);
        }


        defaultOpenInDockableWindow = EditorPrefs.GetBool(pb_Constant.pbDefaultOpenInDockableWindow);

        pbDefaultSelectionMode = pb_Preferences_Internal.GetEnum <SelectMode>(pb_Constant.pbDefaultSelectionMode);
        defaultColliderType    = (int)pb_Preferences_Internal.GetEnum <ColliderType>(pb_Constant.pbDefaultCollider);

        pbDragCheckLimit   = pb_Preferences_Internal.GetBool(pb_Constant.pbDragCheckLimit);
        pbForceConvex      = pb_Preferences_Internal.GetBool(pb_Constant.pbForceConvex);
        pbForceGridPivot   = pb_Preferences_Internal.GetBool(pb_Constant.pbForceGridPivot);
        pbForceVertexPivot = pb_Preferences_Internal.GetBool(pb_Constant.pbForceVertexPivot);
        pbHideWireframe    = pb_Preferences_Internal.GetBool(pb_Constant.pbHideWireframe);

        pbManifoldEdgeExtrusion   = pb_Preferences_Internal.GetBool(pb_Constant.pbManifoldEdgeExtrusion);
        pbPerimeterEdgeBridgeOnly = pb_Preferences_Internal.GetBool(pb_Constant.pbPerimeterEdgeBridgeOnly);

        pbPBOSelectionOnly = pb_Preferences_Internal.GetBool(pb_Constant.pbPBOSelectionOnly);

        pbCloseShapeWindow = pb_Preferences_Internal.GetBool(pb_Constant.pbCloseShapeWindow);

        pbVertexHandleSize = pb_Preferences_Internal.GetFloat(pb_Constant.pbVertexHandleSize);

        pbUVEditorFloating = pb_Preferences_Internal.GetBool(pb_Constant.pbUVEditorFloating);

        pbShowSceneToolbar = pb_Preferences_Internal.GetBool(pb_Constant.pbShowSceneToolbar);

        _defaultMaterial = pb_Preferences_Internal.GetMaterial(pb_Constant.pbDefaultMaterial);

        defaultShortcuts = EditorPrefs.HasKey(pb_Constant.pbDefaultShortcuts) ?
                           pb_Shortcut.ParseShortcuts(EditorPrefs.GetString(pb_Constant.pbDefaultShortcuts)) :
                           pb_Shortcut.DefaultShortcuts();

        _showNotifications = EditorPrefs.HasKey(pb_Constant.pbShowEditorNotifications) ?
                             EditorPrefs.GetBool(pb_Constant.pbShowEditorNotifications) : true;
    }
Exemplo n.º 2
0
 public static void LoadAccountDetails()
 {
     if (EditorPrefs.HasKey(keyPrefix + "PlayFab_DeveloperAccountDetails"))
     {
         var serialized = EditorPrefs.GetString(keyPrefix + "PlayFab_DeveloperAccountDetails");
         try
         {
             accountDetails = Json.JsonWrapper.DeserializeObject <PlayFab_DeveloperAccountDetails>(serialized);
             return;
         }
         catch (Exception ex)
         {
             PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnError, ex.Message);
         }
     }
     accountDetails = new PlayFab_DeveloperAccountDetails();
 }
Exemplo n.º 3
0
        public static OSCTransmitter GetTransmitter(string settingPath, OSCTransmitter defaultTransmitter)
        {
            var keyHost = settingPath + ".remotehost";
            var keyPort = settingPath + ".remoteport";

            if (!EditorPrefs.HasKey(keyHost) || !EditorPrefs.HasKey(keyPort))
            {
                return(defaultTransmitter);
            }

            var remoteHost = EditorPrefs.GetString(keyHost, "");
            var remotePort = EditorPrefs.GetInt(keyPort + ".remoteport", 0);

            return(OSCEditorUtils.FindTransmitter(remoteHost, remotePort));

            ;
        }
Exemplo n.º 4
0
        static UnityLock()
        {
            if (!EditorPrefs.HasKey(ShowIconPrefKey))
            {
                EditorPrefs.SetBool(ShowIconPrefKey, true);
            }

            if (!EditorPrefs.HasKey(AddUndoRedoPrefKey))
            {
                EditorPrefs.SetBool(AddUndoRedoPrefKey, true);
            }

            if (!EditorPrefs.HasKey(DisableSelectionPrefKey))
            {
                EditorPrefs.SetBool(DisableSelectionPrefKey, false);
            }
        }
        static void Load()
        {
            if (!EditorPrefs.HasKey(ppKey))
            {
                return;
            }

            string serializedDataString = EditorPrefs.GetString(ppKey);

            EditorPrefs.DeleteKey(ppKey);

            // It's faster to check for differences than to actually restore, so we do that first.
            if (!CheckForChanges(serializedDataString))
            {
                return;
            }

            var serializedData = new PlayModeSaver.SerializedSelection();

            EditorJsonUtility.FromJsonOverwrite(serializedDataString, serializedData);

            if (!PlayModeSaver.CanDeserialize(serializedData))
            {
                if (serializedData.foundStatic)
                {
                    Debug.LogError("SavePlayModeChangesChecker SerializedSelection data contains a gameobject with the static flag. The static flag combines meshes on mesh filters, and so cannot properly restore them.\nIf you would like to rescue the data, it has been stored in EditorPrefs at key '" + serializedDataString + "'.");
                    PlayerPrefs.SetString(ppKey, serializedDataString);
                }
                return;
            }

            EditorUtility.DisplayProgressBar("Save Edit Mode Changes", "Restoring Edit Mode GameObjects...", 0);

            try {
                var restoredGameObjects = PlayModeSaver.Deserialize(serializedData, true);
                LogRestoredData(restoredGameObjects);
                EditorUtility.ClearProgressBar();
                if (OnRestorePlayModeChanges != null)
                {
                    OnRestorePlayModeChanges(restoredGameObjects);
                }
            } catch {
                Debug.LogError("Play mode saver failed to restore data after destroying originals. Scene backups were placed on your desktop which will allow you to recover data.");
                EditorUtility.ClearProgressBar();
            }
        }
Exemplo n.º 6
0
        private static void ManageInputMappings()
        {
            if (isManualCheck)
            {
                ShowWindow();
            }
            else if (EditorPrefs.HasKey(GetProjectKeyName()) || AxisDefined(axis3.name))
            {
                EditorApplication.delayCall -= ManageInputMappings;
                return;
            }

            EditorApplication.delayCall -= ManageInputMappings;

            ShowWindow();
            isManualCheck = false;
        }
Exemplo n.º 7
0
    private static void ArmorPaintPaintOption()
    {
        if (Selection.gameObjects.Length == 0)
        {
            return;
        }

        string     name = Selection.gameObjects[0].name;
        Transform  t    = Selection.gameObjects[0].transform;
        MeshFilter mf   = t.GetComponent <MeshFilter>();

        if (mf == null)
        {
            return;
        }

        string path;
        string binpath;

        if (!EditorPrefs.HasKey("ArmorPaintPath"))
        {
            path = ArmorPaintPathOption();
        }
        else
        {
            path = EditorPrefs.GetString("ArmorPaintPath");
        }
        if (!EditorPrefs.HasKey("ArmorPaintBinPath"))
        {
            binpath = ArmorPaintPathBinOption();
        }
        else
        {
            binpath = EditorPrefs.GetString("ArmorPaintBinPath");
        }

        string filepath = path + "/data/temp.obj";

        binpath = binpath + "/ArmorPaint";

        using (StreamWriter sw = new StreamWriter(filepath)) {
            sw.Write(MeshToObj(mf, name));
        }

        System.Diagnostics.Process.Start(binpath, filepath);
    }
Exemplo n.º 8
0
    static void OnInit()
    {
        EditorApplication.update -= OnInit;
        if (!EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isCompiling && !EditorApplication.isUpdating)
        {
            if (!EditorPrefs.HasKey("ZED_NoWarning_Plugin"))
            {
                EditorApplication.update += UpdateWnd;
            }
        }
        else
        {
            EditorApplication.update += UpdateLog;
        }

        EditorApplication.update += UpdateSettingsWnd;
    }
Exemplo n.º 9
0
   public static void Boot()
   {
 #if !UNITY_POST_PROCESSING_STACK_V2
       Debug.LogWarning("PostProcessing is not installed in the project. For UdonToolkit CameraSystem to work please import PostProcessing from Window -> Package Manager");
 #endif
       var shouldBoot = true;
       if (EditorPrefs.HasKey(bootKey))
       {
           shouldBoot = EditorPrefs.GetBool(bootKey);
       }
       if (!shouldBoot)
       {
           return;
       }
       ShowWindow();
       EditorPrefs.SetBool(bootKey, false);
   }
        private static void Update()
        {
            var datapath = Application.dataPath;
            var strval   = datapath.Split("/"[0]);

            prefkey = strval[strval.Length - 2];

            showdialogwindow = !EditorPrefs.HasKey(prefkey);
            if (showdialogwindow)
            {
                dialogwindow         = GetWindow <SettingsPrompt>(true);
                dialogwindow.minSize = new Vector2(350, 380);
                defaultqualitylevel  = QualitySettings.GetQualityLevel();
            }

            EditorApplication.update -= Update;
        }
Exemplo n.º 11
0
        private void GetEditorPrefs()
        {
            protocolNumber = (EditorPrefs.HasKey("UrdfImporterProtocolNumber") ?
                              EditorPrefs.GetInt("UrdfImporterProtocolNumber") : 1);

            address = (EditorPrefs.HasKey("UrdfImporterAddress") ?
                       EditorPrefs.GetString("UrdfImporterAddress") :
                       "ws://192.168.0.1:9090");

            assetPath = (EditorPrefs.HasKey("UrdfImporterAssetPath") ?
                         EditorPrefs.GetString("UrdfImporterAssetPath") :
                         Path.Combine(Path.Combine(Path.GetFullPath("."), "Assets"), "Urdf"));

            timeout = (EditorPrefs.HasKey("UrdfImporterTimeout") ?
                       EditorPrefs.GetInt("UrdfImporterTimeout") :
                       10);
        }
        }                                                                                            //list of assets to be added

        void OnEnable()
        {
            if (EditorPrefs.HasKey("modOutPutPath"))
            {
                modOutPutPath = EditorPrefs.GetString("modOutPutPath", GetTempModDirPath());
            }
            else
            {
                modOutPutPath = GetTempModDirPath();
            }
            if (EditorPrefs.HasKey("lastModFile"))
            {
                currentFilePath = EditorPrefs.GetString("lastModFile");
            }

            modInfo = ReadModInfoFile(currentFilePath);
        }
Exemplo n.º 13
0
        public static T GetEditorPrefs <T>(string key, T defaultValue)
        {
            if (EditorPrefs.HasKey(key))
            {
                Type tt = typeof(T);
                try
                {
                    if (tt.IsEnum || tt.Matches(typeof(int), typeof(Int32)))
                    {
                        return((T)(object)EditorPrefs.GetInt(key, (int)(object)defaultValue));
                    }
                    else if (tt.IsArray)
                    {
                        throw new System.NotImplementedException();
                    }
                    else if (tt == typeof(string))
                    {
                        return((T)(object)EditorPrefs.GetString(key, defaultValue.ToString()));
                    }
                    else if (tt == typeof(float))
                    {
                        return((T)(object)EditorPrefs.GetFloat(key, (float)(object)defaultValue));
                    }
                    else if (tt == typeof(bool))
                    {
                        return((T)(object)EditorPrefs.GetBool(key, (bool)(object)defaultValue));
                    }
                    else if (tt == typeof(Color))
                    {
                        return((T)(object)EditorPrefs.GetString(key, ((Color)(object)defaultValue).ToHtml()).ColorFromHtml());
                    }
                    else
                    {
                        DTLog.LogError("[DevTools] SetEditorPrefs: Unsupported datatype: " + tt.Name);
                    }
                }
                catch
                {
                    return(defaultValue);
                }
            }


            return(defaultValue);
        }
Exemplo n.º 14
0
 /// <summary>Loads user preferences for hotkeys.</summary>
 public static void LoadHotkeys()
 {
     // Check for a random key to see if we have any data at all.
     if (EditorPrefs.HasKey(AssetName + " - DontShowWindow"))
     {
         if (BlenderActions.Main != null)
         {                //
             foreach (var hotkey in BlenderActions.Main.AllActions)
             {
                 if (EditorPrefs.HasKey(AssetName + " - " + hotkey.Value.InternalName + "_MainKey"))
                 {
                     hotkey.Value.MainKeyCode = (KeyCode)EditorPrefs.GetInt(AssetName + " - " + hotkey.Value.InternalName + "_MainKey");
                 }
                 if (EditorPrefs.HasKey(AssetName + " - " + hotkey.Value.InternalName + "_SecondaryKey"))
                 {
                     hotkey.Value.SecondaryKeyCode = (KeyCode)EditorPrefs.GetInt(AssetName + " - " + hotkey.Value.InternalName + "_SecondaryKey");
                 }
                 if (EditorPrefs.HasKey(AssetName + " - " + hotkey.Value.InternalName + "_MainMouse"))
                 {
                     hotkey.Value.MainMouseButton = EditorPrefs.GetInt(AssetName + " - " + hotkey.Value.InternalName + "_MainMouse");
                 }
                 if (EditorPrefs.HasKey(AssetName + " - " + hotkey.Value.InternalName + "_SecondaryMouse"))
                 {
                     hotkey.Value.SecondaryMouseButton = EditorPrefs.GetInt(AssetName + " - " + hotkey.Value.InternalName + "_SecondaryMouse");
                 }
                 if (EditorPrefs.HasKey(AssetName + " - " + hotkey.Value.InternalName + "_Control"))
                 {
                     hotkey.Value.Control = EditorPrefs.GetBool(AssetName + " - " + hotkey.Value.InternalName + "_Control");
                 }
                 if (EditorPrefs.HasKey(AssetName + " - " + hotkey.Value.InternalName + "_Shift"))
                 {
                     hotkey.Value.Shift = EditorPrefs.GetBool(AssetName + " - " + hotkey.Value.InternalName + "_Shift");
                 }
                 if (EditorPrefs.HasKey(AssetName + " - " + hotkey.Value.InternalName + "_Alt"))
                 {
                     hotkey.Value.Alt = EditorPrefs.GetBool(AssetName + " - " + hotkey.Value.InternalName + "_Alt");
                 }
                 if (EditorPrefs.HasKey(AssetName + " - " + hotkey.Value.InternalName + "_Any"))
                 {
                     hotkey.Value.Any = EditorPrefs.GetBool(AssetName + " - " + hotkey.Value.InternalName + "_Any");
                 }
             }
         }
     }
 }
Exemplo n.º 15
0
    public static void LoadPrefs()
    {
        _faceColor = pb_Preferences_Internal.GetColor(pb_Constant.pbDefaultFaceColor);

        pbDefaultSelectedVertexColor = pb_Preferences_Internal.GetColor(pb_Constant.pbDefaultSelectedVertexColor);
        pbDefaultVertexColor         = pb_Preferences_Internal.GetColor(pb_Constant.pbDefaultVertexColor);

        if (!EditorPrefs.HasKey(pb_Constant.pbDefaultOpenInDockableWindow))
        {
            EditorPrefs.SetBool(pb_Constant.pbDefaultOpenInDockableWindow, true);
        }

        defaultHideFaceMask = (EditorPrefs.HasKey(pb_Constant.pbDefaultHideFaceMask)) ? EditorPrefs.GetBool(pb_Constant.pbDefaultHideFaceMask) : false;

        defaultOpenInDockableWindow = EditorPrefs.GetBool(pb_Constant.pbDefaultOpenInDockableWindow);

        pbDefaultSelectionMode = pb_Preferences_Internal.GetEnum <SelectMode>(pb_Constant.pbDefaultSelectionMode);
        defaultColliderType    = (int)pb_Preferences_Internal.GetEnum <ProBuilder.ColliderType>(pb_Constant.pbDefaultCollider);

        pbDragCheckLimit   = pb_Preferences_Internal.GetBool(pb_Constant.pbDragCheckLimit);
        pbForceConvex      = pb_Preferences_Internal.GetBool(pb_Constant.pbForceConvex);
        pbForceGridPivot   = pb_Preferences_Internal.GetBool(pb_Constant.pbForceGridPivot);
        pbForceVertexPivot = pb_Preferences_Internal.GetBool(pb_Constant.pbForceVertexPivot);

        pbPerimeterEdgeExtrusionOnly = pb_Preferences_Internal.GetBool(pb_Constant.pbPerimeterEdgeExtrusionOnly);
        pbPerimeterEdgeBridgeOnly    = pb_Preferences_Internal.GetBool(pb_Constant.pbPerimeterEdgeBridgeOnly);

        pbVertexHandleSize = pb_Preferences_Internal.GetFloat(pb_Constant.pbVertexHandleSize);

        if (EditorPrefs.HasKey(pb_Constant.pbDefaultMaterial))
        {
            _defaultMaterial = (Material)Resources.LoadAssetAtPath(pb_Constant.pbDefaultMaterial, typeof(Material));
            if (_defaultMaterial == null)
            {
                _defaultMaterial = ProBuilder.DefaultMaterial;
            }
        }

        defaultShortcuts = EditorPrefs.HasKey(pb_Constant.pbDefaultShortcuts) ?
                           pb_Shortcut.ParseShortcuts(EditorPrefs.GetString(pb_Constant.pbDefaultShortcuts)) :
                           pb_Shortcut.DefaultShortcuts();

        _showNotifications = EditorPrefs.HasKey(pb_Constant.pbShowEditorNotifications) ?
                             EditorPrefs.GetBool(pb_Constant.pbShowEditorNotifications) : true;
    }
Exemplo n.º 16
0
 private void LoadEditorSettings()
 {
     registerCompleteObjectUndo = EditorPrefs.GetBool(CompleteUndoKey, true);
     showDatabaseName           = EditorPrefs.GetBool(ShowDatabaseNameKey, true);
     autoBackupFrequency        = EditorPrefs.GetFloat(AutoBackupKey, DefaultAutoBackupFrequency);
     autoBackupFolder           = EditorPrefs.GetString(AutoBackupFolderKey, string.Empty);
     timeForNextAutoBackup      = Time.realtimeSinceStartup + autoBackupFrequency;
     addNewNodesToRight         = EditorPrefs.GetBool(AddNewNodesToRightKey, false);
     trimWhitespaceAroundPipes  = EditorPrefs.GetBool(TrimWhitespaceAroundPipesKey, true);
     if (EditorPrefs.HasKey(LocalizationLanguagesKey))
     {
         localizationLanguages = JsonUtility.FromJson <LocalizationLanguages>(EditorPrefs.GetString(LocalizationLanguagesKey));
     }
     if (EditorPrefs.HasKey(SequencerDragDropCommandsKey))
     {
         SequenceEditorTools.RestoreDragDropCommands(EditorPrefs.GetString(SequencerDragDropCommandsKey));
     }
 }
Exemplo n.º 17
0
        public static void SetLongPref(string pName, string pValue)
        {
            string value = "";
            int    index = 0;

            while (pValue.Length > 1000)
            {
                value = pValue.Substring(0, 1000);
                EditorPrefs.SetString(pName + index++, value);
                pValue = pValue.Substring(1000);
            }
            EditorPrefs.SetString(pName + index++, pValue);

            while (EditorPrefs.HasKey(pName + index))
            {
                EditorPrefs.DeleteKey(pName + index++);
            }
        }
        static void createWizardFromMenu( )
        {
            var helper = ScriptableWizard.DisplayWizard <GlobalDefinesWizard>("Global Defines Manager", "Save", "Cancel");

            helper.minSize = new Vector2(500, 300);
            helper.maxSize = new Vector2(500, 300);

            // load up the defines
            if (EditorPrefs.HasKey(_prefsKey))
            {
                var data   = EditorPrefs.GetString(_prefsKey);
                var bytes  = System.Convert.FromBase64String(data);
                var stream = new MemoryStream(bytes);

                var formatter = new BinaryFormatter();
                helper._globalDefines = (List <GlobalDefine>)formatter.Deserialize(stream);
            }
        }
Exemplo n.º 19
0
        public static bool ShouldOpen()
        {
            var hasKey = EditorPrefs.HasKey(WelcomeWindowPlayerPrefsKey);

            if (!hasKey)
            {
                return(true);
            }

            var value = EditorPrefs.GetString(WelcomeWindowPlayerPrefsKey);

            if (value != SRDebug.Version)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 20
0
        public void Save()
        {
            string keyPrefix = COUNTRY_PREFIX + Application.productName + Application.companyName;

            for (int i = 0; i < LanguageDef.Length; i++)
            {
                if (EditorPrefs.HasKey(keyPrefix + LanguageDef[i]))
                {
                    EditorPrefs.DeleteKey(keyPrefix + LanguageDef[i]);
                }
            }

            foreach (LanguageData languageData in SupportedLanguageItems)
            {
                EditorPrefs.SetString(keyPrefix + LanguageDef[languageData.Index], languageData.AppName);
                Debug.Log(keyPrefix + LanguageDef[languageData.Index] + ":" + languageData.AppName);
            }
        }
Exemplo n.º 21
0
    /**
     * \brief ProBuilder objects created in Editor need to be initialized with a number of additional Editor-only settings.
     *	This method provides an easy method of doing so in a single call.  #InitObjectFlags will set the Entity Type, generate
     *	a UV2 channel, set the unwrapping parameters, and center the object in the screen.
     */
    public static void InitObjectFlags(pb_Object pb, ColliderType col, EntityType et)
    {
        switch (col)
        {
        case ColliderType.BoxCollider:
            pb.gameObject.AddComponent <BoxCollider>();
            break;

        case ColliderType.MeshCollider:
            pb.gameObject.AddComponent <MeshCollider>().convex = EditorPrefs.HasKey(pb_Constant.pbForceConvex) ? EditorPrefs.GetBool(pb_Constant.pbForceConvex) : false;
            break;
        }

        pb_Lightmap_Editor.SetObjectUnwrapParamsToDefault(pb);
        pb.GenerateUV2(true);
        pb_Editor_Utility.SetEntityType(et, pb.gameObject);
        pb_Editor_Utility.ScreenCenter(pb.gameObject);
    }
Exemplo n.º 22
0
    static StartupChecks()
    {
        if (!overridePrefs)
        {
            if (!EditorPrefs.HasKey(EditorPrefsKey))
            {
                EditorPrefs.SetBool(EditorPrefsKey, true);
            }
            else if (!EditorPrefs.GetBool(EditorPrefsKey))
            {
                return;
            }
        }

        EditorApplication.update += Update;
        timeLaunched              = Time.realtimeSinceStartup;
        lastCheck = -checkInterval;
    }
Exemplo n.º 23
0
        public static List <string> LoadList(string key)
        {
            var listLengthKey = key + ".length";

            if (!EditorPrefs.HasKey(listLengthKey))
            {
                return(new List <string>());
            }

            List <string> result     = new List <string>();
            var           listLength = EditorPrefs.GetInt(listLengthKey);

            for (int i = 0; i < listLength; i++)
            {
                result.Add(EditorPrefs.GetString(key + "[" + i + "]", ""));
            }
            return(result);
        }
Exemplo n.º 24
0
 private void Update()
 {
     //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
     //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
     if (!EditorApplication.get_isPlaying() && !EditorApplication.get_isPlayingOrWillChangePlaymode())
     {
         if (EditorPrefs.HasKey("blueprintID-" + pipeline.GetInstanceID().ToString()))
         {
             string @string = EditorPrefs.GetString("blueprintID-" + pipeline.GetInstanceID().ToString());
             pipeline.blueprintId = @string;
             EditorPrefs.DeleteKey("blueprintID-" + pipeline.GetInstanceID().ToString());
         }
         EditorUtility.SetDirty(pipeline);
         EditorSceneManager.MarkSceneDirty(pipeline.get_gameObject().get_scene());
         EditorSceneManager.SaveScene(pipeline.get_gameObject().get_scene());
         Object.DestroyImmediate(this);
     }
 }
        public static Core.RestAPI.SpacesPlatformServicesSettings GetEditorToken()
        {
            var token = ScriptableObject.CreateInstance <Core.RestAPI.SpacesPlatformServicesSettings>();

            if (PlayerPrefs.HasKey(Spaces.Core.Constants.PLATFORM_SERVICES_SETTINGS))
            {
                var settings = PlayerPrefs.GetString(Spaces.Core.Constants.PLATFORM_SERVICES_SETTINGS);
                JsonUtility.FromJsonOverwrite(settings, token);
            }

            if (EditorPrefs.HasKey(ServicesSettings))
            {
                var settings = EditorPrefs.GetString(ServicesSettings);
                JsonUtility.FromJsonOverwrite(settings, token);
            }

            return(token);
        }
        static AskFeedbackDialog()
        {
            if (EditorPrefs.HasKey(StopShowingKey))
            {
                return;
            }

            int InitializeOnLoadCount = EditorPrefs.GetInt(InitializeOnLoadCountKey, 0);

            if (InitializeOnLoadCount > 20)
            {
                ShowDialog();
            }
            else
            {
                EditorPrefs.SetInt(InitializeOnLoadCountKey, InitializeOnLoadCount + 1);
            }
        }
Exemplo n.º 27
0
        static AutoSave()
        {
            if (!EditorPrefs.HasKey(ENABLED_PREF))
            {
                DefaultRunInBackground = Application.runInBackground;
            }

            if (AutoSaveEnabled)
            {
                EnableAutoSave();
            }
                        #if !UNITY_2017_2_OR_NEWER
            else if (AutoSaveAfterPlay)
            {
                SaveScenes();
            }
                        #endif
        }
Exemplo n.º 28
0
        public static bool DoToolbarEx(string label, Rect rect, Action add = null, Action leftButton = null, Action paste = null, Action clicked = null, bool defOn = true, Color?color = null)
        {
            if (!EditorPrefs.HasKey(label))
            {
                EditorPrefs.SetBool(label, defOn);
            }
            var tBar = DoToolbar(label, EditorPrefs.GetBool(label, true), rect, add, leftButton, paste, null, null, true, color);

            if (tBar)
            {
                if (clicked != null)
                {
                    clicked();
                }
                EditorPrefs.SetBool(label, !EditorPrefs.GetBool(label));
            }
            return(EditorPrefs.GetBool(label));
        }
Exemplo n.º 29
0
    private void CreateData()
    {
        if (EditorPrefs.HasKey("HsmFile"))
        {
            _fileName = EditorPrefs.GetString("HsmFile");
        }

        if (string.IsNullOrEmpty(_fileName))
        {
            _HSMTreeData = new SkillHsmConfigHSMTreeData();
            AddNode("Entry", IDENTIFICATION.STATE_ENTRY, NODE_TYPE.ENTRY, new Vector3(500, 150, 0), -1);
            AddNode("Exit", IDENTIFICATION.STATE_EXIT, NODE_TYPE.EXIT, new Vector3(500, 550, 0), -1);
        }
        else
        {
            LoadFile(_fileName);
        }
    }
        void LoadEditor()
        {
            string path = GetIndexHTMLPath();

#if APLUS_DEV
            if (useServerMode)
            {
                path = "http://127.0.0.1:8080";
            }
#endif

            if (EditorPrefs.HasKey(ASSETEXPLORER_PREVOIUS_URL))
            {
                path = EditorPrefs.GetString(ASSETEXPLORER_PREVOIUS_URL);
            }

            LoadURL(path);
        }