Пример #1
0
        static void SaveDefaults()
        {
            if (connection != connectionUpdate)
            {
                connectionUpdate = connection;
                MegascansBridgeLink.ToggleServer(connection);
            }

            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("QuixelDefaultImportLODs", importLODs);
            EditorPrefs.SetBool("QuixelDefaultSetupLOD", setupLOD);
            EditorPrefs.SetBool("QuixelDefaultSetupPrefabs", setupPrefabs);
            EditorPrefs.SetBool("QuixelDefaultFlipNormalY", flipNormalY);
            EditorPrefs.SetInt("QuixelDefaultImportResolution", importResolution);
            EditorPrefs.SetInt("QuixelDefaultLodFadeMode", lodFadeMode);
            EditorPrefs.SetBool("QuixelDefaultImportAllTextures", importAllTextures);

            pathUpdate              = path;
            dispTypeUpdate          = dispType;
            texPackUpdate           = texPack;
            shaderTypeUpdate        = shaderType;
            importResolutionUpdate  = importResolution;
            setupCollisionUpdate    = setupCollision;
            applyToSelectionUpdate  = applyToSelection;
            addAssetToSceneUpdate   = addAssetToScene;
            setupPrefabsUpdate      = setupPrefabs;
            importLODsUpdate        = importLODs;
            setupLODUpdate          = setupLOD;
            flipNormalYUpdate       = flipNormalY;
            lodFadeModeUpdate       = lodFadeMode;
            importAllTexturesUpdate = importAllTextures;

            //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
        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;
        }
Пример #3
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);
            importLODs        = EditorPrefs.GetBool("QuixelDefaultImportLODs", true);
            setupLOD          = EditorPrefs.GetBool("QuixelDefaultSetupLOD", true);
            setupPrefabs      = EditorPrefs.GetBool("QuixelDefaultSetupPrefabs", true);
            flipNormalY       = EditorPrefs.GetBool("QuixelDefaultFlipNormalY", false);
            importAllTextures = EditorPrefs.GetBool("QuixelDefaultImportAllTextures", 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;
            setupPrefabsUpdate      = setupPrefabs;
            importLODsUpdate        = importLODs;
            setupLODUpdate          = setupLOD;
            flipNormalYUpdate       = flipNormalY;
            importResolutionUpdate  = importResolution;
            lodFadeModeUpdate       = lodFadeMode;
            importAllTexturesUpdate = importAllTextures;

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

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

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