예제 #1
0
        static void SaveDefaults()
        {
            if (connection != connectionUpdate)
            {
                if (connection)
                {
                    MegascansBridgeLink.StartServer();
                }
                else
                {
                    MegascansBridgeLink.EndServer();
                }
            }

            EditorPrefs.SetString("QuixelDefaultPath", path);
            EditorPrefs.SetInt("QuixelDefaultDisplacement", dispType);
            EditorPrefs.SetInt("QuixelDefaultTexPacking", texPack);
            EditorPrefs.SetInt("QuixelDefaultShader", shaderType);
            EditorPrefs.SetBool("QuixelDefaultConnection", connection);
            EditorPrefs.SetBool("QuixelDefaultSetupCollision", setupCollision);
            EditorPrefs.SetBool("QuixelDefaultApplyToSelection", applyToSelection);
            EditorPrefs.SetBool("QuixelDefaultAddAssetToScene", addAssetToScene);
            EditorPrefs.SetBool("QuixelDefaultTerrainNormal", terrainNormal);
            EditorPrefs.SetInt("QuixelDefaultImportResolution", importResolution);
            EditorPrefs.SetInt("QuixelDefaultLodFadeMode", lodFadeMode);

            pathUpdate             = path;
            dispTypeUpdate         = dispType;
            texPackUpdate          = texPack;
            shaderTypeUpdate       = shaderType;
            importResolutionUpdate = importResolution;
            connectionUpdate       = connection;
            setupCollisionUpdate   = setupCollision;
            applyToSelectionUpdate = applyToSelection;
            addAssetToSceneUpdate  = addAssetToScene;
            terrainNormalUpdate    = terrainNormal;
            lodFadeModeUpdate      = lodFadeMode;

            //Decal Properties

            EditorPrefs.SetString("QuixelDefaultDecalBlend", decalBlend);
            EditorPrefs.SetString("QuixelDefaultDecalSize", decalSize);

            decalBlendUpdate = decalBlend;
            decalSizeUpdate  = decalSize;

            //Terrain tool properties

            EditorPrefs.SetString("QuixelDefaultMaterialName", terrainMaterialName);
            EditorPrefs.SetString("QuixelDefaultMaterialPath", terrainMaterialPath);
            EditorPrefs.SetString("QuixelDefaultTiling", tiling);

            terrainMaterialNameUpdate = terrainMaterialName;
            terrainMaterialPathUpdate = terrainMaterialPath;
            tilingUpdate = tiling;
        }
예제 #2
0
        //If the values dont exist in editor prefs they are replaced with the default values.
        internal static void GetDefaults()
        {
            path             = EditorPrefs.GetString("QuixelDefaultPath", "Quixel/Megascans/");
            dispType         = EditorPrefs.GetInt("QuixelDefaultDisplacement", 0);
            texPack          = EditorPrefs.GetInt("QuixelDefaultTexPacking", 0);
            shaderType       = EditorPrefs.GetInt("QuixelDefaultShader", 3);
            importResolution = EditorPrefs.GetInt("QuixelDefaultImportResolution", 4);
            lodFadeMode      = EditorPrefs.GetInt("QuixelDefaultLodFadeMode", 1);
            connection       = EditorPrefs.GetBool("QuixelDefaultConnection", true);
            setupCollision   = EditorPrefs.GetBool("QuixelDefaultSetupCollision", true);
            applyToSelection = EditorPrefs.GetBool("QuixelDefaultApplyToSelection", false);
            addAssetToScene  = EditorPrefs.GetBool("QuixelDefaultAddAssetToScene", false);
            terrainNormal    = EditorPrefs.GetBool("QuixelDefaultTerrainNormal", false);

            decalBlend = EditorPrefs.GetString("QuixelDefaultDecalBlend", "100");
            decalSize  = EditorPrefs.GetString("QuixelDefaultDecalSize", "1");

            terrainMaterialName = EditorPrefs.GetString("QuixelDefaultMaterialName", "Terrain Material");
            terrainMaterialPath = EditorPrefs.GetString("QuixelDefaultMaterialPath", "Quixel/");
            tiling = EditorPrefs.GetString("QuixelDefaultTiling", "10");

            pathUpdate             = path;
            dispTypeUpdate         = dispType;
            texPackUpdate          = texPack;
            shaderTypeUpdate       = shaderType;
            connectionUpdate       = connection;
            setupCollisionUpdate   = setupCollision;
            applyToSelectionUpdate = applyToSelection;
            addAssetToSceneUpdate  = addAssetToScene;
            terrainNormalUpdate    = terrainNormal;
            importResolutionUpdate = importResolution;
            lodFadeModeUpdate      = lodFadeMode;

            //Decal Properties
            decalBlendUpdate = decalBlend;
            decalSizeUpdate  = decalSize;

            //Terrain tool properties
            terrainMaterialNameUpdate = terrainMaterialName;
            terrainMaterialPathUpdate = terrainMaterialPath;
            tilingUpdate = tiling;

            if (connection)
            {
                MegascansBridgeLink.StartServer();
            }
        }