Пример #1
0
        private void ExportNormal()
        {
            if (Terrain.activeTerrain == null)
            {
                EditorUtility.DisplayDialog("OOPS!", "You must have a valid terrain in your scene!!", "OK");
                return;
            }

            GaiaWorldManager mgr = new GaiaWorldManager(Terrain.activeTerrains);

            if (mgr.TileCount > 0)
            {
                string path = "Assets/GaiaMasks/";
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }

                path = Path.Combine(path, Gaia.Utils.FixFileName(m_maskName));
                mgr.ExportNormalmapAsPng(path);
                AssetDatabase.Refresh();

                EditorUtility.DisplayDialog("Export complete", " Your normal map has been saved to : " + path, "OK");
            }
        }
Пример #2
0
        private void ExportNormal()
        {
            if (Terrain.activeTerrain == null)
            {
                EditorUtility.DisplayDialog("OOPS!", "You must have a valid terrain in your scene!!", "OK");
                return;
            }

            GaiaWorldManager mgr = new GaiaWorldManager(Terrain.activeTerrains);

            if (mgr.TileCount > 0)
            {
                GaiaSessionManager gsm  = GaiaSessionManager.GetSessionManager();
                string             path = GaiaDirectories.GetExportDirectory(gsm.m_session);
                mgr.LoadFromWorld();
                path = Path.Combine(path, PWCommon4.Utils.FixFileName(m_maskName));
                mgr.ExportNormalmapAsPng(path);
                AssetDatabase.Refresh();

                EditorUtility.DisplayDialog("Export complete", " Your normal map has been saved to : " + path, "OK");
            }
        }