72 lines
2.4 KiB
C#
72 lines
2.4 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.IO;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using UnityEditor;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
namespace Thousandto.Editor.Test
|
|||
|
{
|
|||
|
public partial class SplitTerrainWindow : UnityEditor.EditorWindow
|
|||
|
{
|
|||
|
private bool _foldOutLoadBlock = true;
|
|||
|
|
|||
|
public void DrawLoadBlockRegion()
|
|||
|
{
|
|||
|
var oldColor = GUI.contentColor;
|
|||
|
GUI.contentColor = Color.green;
|
|||
|
_foldOutLoadBlock = EditorGUILayout.Foldout(_foldOutLoadBlock, "Load blocks");
|
|||
|
GUI.contentColor = oldColor;
|
|||
|
if (_foldOutLoadBlock)
|
|||
|
{
|
|||
|
GUILayout.Box(" 1. 加载所有网格 \n 2. 加载选中的网格 \n 3. 有些网格是拓展了1格的,需要删除掉扩展的部分", EditorStyles.helpBox, GUILayout.Width(WINDOW_WIDTH), GUILayout.Height(50));
|
|||
|
//ShowNotification(_content1);
|
|||
|
DrawLoadBlocksButton();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void DrawLoadBlocksButton()
|
|||
|
{
|
|||
|
GUILayout.BeginHorizontal();
|
|||
|
if (GUILayout.Button("LoadAllBlock(TODO)", GUILayout.MaxWidth(200)))
|
|||
|
{
|
|||
|
return;
|
|||
|
SplitTerrain st = new SplitTerrain();
|
|||
|
st.ShowMeshBlocks();
|
|||
|
}
|
|||
|
|
|||
|
if (GUILayout.Button("LoadSelectBlock", GUILayout.MaxWidth(200)))
|
|||
|
{
|
|||
|
for (int i = 0; i < Selection.objects.Length; ++i)
|
|||
|
{
|
|||
|
SplitTerrain.ShowMeshBlock(AssetDatabase.GetAssetPath(Selection.objects[i]));
|
|||
|
}
|
|||
|
}
|
|||
|
GUILayout.EndHorizontal();
|
|||
|
|
|||
|
GUILayout.BeginHorizontal();
|
|||
|
|
|||
|
if (GUILayout.Button("Del one expanded mesh", GUILayout.MaxWidth(200)))
|
|||
|
{
|
|||
|
for (int i = 0; i < Selection.objects.Length; ++i)
|
|||
|
{
|
|||
|
var savePath = AssetDatabase.GetAssetPath(Selection.objects[i]);
|
|||
|
SplitTerrain.DeleteExpandedMesh(savePath);
|
|||
|
}
|
|||
|
EditorUtility.ClearProgressBar();
|
|||
|
}
|
|||
|
|
|||
|
if (GUILayout.Button("Collect Things", GUILayout.MaxWidth(200)))
|
|||
|
{
|
|||
|
CollectThings ct = new CollectThings();
|
|||
|
ct.SetResolution(_mapSize, _blockSize);
|
|||
|
ct.Collect(_curTerrainData.name);
|
|||
|
}
|
|||
|
|
|||
|
GUILayout.EndHorizontal();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|