更新空气墙
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using IndianOceanAssets.Engine2_5D;
|
||||
|
||||
namespace IndianOceanAssets.EditorTools
|
||||
{
|
||||
[CustomEditor(typeof(BoundaryWallGenerator))]
|
||||
public class BoundaryWallGeneratorEditor : UnityEditor.Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
DrawDefaultInspector();
|
||||
|
||||
var generator = (BoundaryWallGenerator)target;
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("操作", EditorStyles.boldLabel);
|
||||
|
||||
if (GUILayout.Button("Build Walls", GUILayout.Height(32)))
|
||||
{
|
||||
Undo.RecordObject(generator, "Build Boundary Walls");
|
||||
generator.Build();
|
||||
EditorUtility.SetDirty(generator);
|
||||
}
|
||||
|
||||
if (GUILayout.Button("Clear Walls", GUILayout.Height(24)))
|
||||
{
|
||||
Undo.RecordObject(generator, "Clear Boundary Walls");
|
||||
generator.ClearGenerated();
|
||||
EditorUtility.SetDirty(generator);
|
||||
}
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
// 显示边界信息
|
||||
var paths = generator.GetBoundaryPaths();
|
||||
if (paths.Count > 0)
|
||||
{
|
||||
EditorGUILayout.LabelField("边界信息", EditorStyles.boldLabel);
|
||||
int total = 0;
|
||||
for (int i = 0; i < paths.Count; i++)
|
||||
{
|
||||
int count = paths[i].Count;
|
||||
total += count;
|
||||
EditorGUILayout.LabelField($" 路径 {i}: {count} 个点");
|
||||
}
|
||||
EditorGUILayout.LabelField($" 合计: {paths.Count} 条路径, {total} 个点");
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.HelpBox(
|
||||
"未检测到边界数据。\n" +
|
||||
"请指定 groundSprite(地面 SpriteRenderer)或 polygonCollider。",
|
||||
MessageType.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: CX8ZvSr8AS7ifO/+W/71ek9Jh25nk6VV6pa880Vh1NIK4VwM8JkfQxg=
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user