aboutsummaryrefslogtreecommitdiff
path: root/Assets/Scripts/DamageVolumeSystem/Editor/DamageGeneratorEditor.cs
diff options
context:
space:
mode:
authorSmallFox <2806143047@qq.com>2026-05-10 11:16:18 +0800
committerSmallFox <2806143047@qq.com>2026-05-10 11:16:18 +0800
commita9cef4bb0b902e3ec2d3b5510e3de4e885f2be90 (patch)
tree05bcb55df0ffc5be1f4d02c2cba6c5ad831614cd /Assets/Scripts/DamageVolumeSystem/Editor/DamageGeneratorEditor.cs
parentd9fac68e24306673ff27e9f1c909a6f600d8dee0 (diff)
feat:合并伤害体积
Diffstat (limited to 'Assets/Scripts/DamageVolumeSystem/Editor/DamageGeneratorEditor.cs')
-rw-r--r--Assets/Scripts/DamageVolumeSystem/Editor/DamageGeneratorEditor.cs57
1 files changed, 57 insertions, 0 deletions
diff --git a/Assets/Scripts/DamageVolumeSystem/Editor/DamageGeneratorEditor.cs b/Assets/Scripts/DamageVolumeSystem/Editor/DamageGeneratorEditor.cs
new file mode 100644
index 0000000..91a2123
--- /dev/null
+++ b/Assets/Scripts/DamageVolumeSystem/Editor/DamageGeneratorEditor.cs
@@ -0,0 +1,57 @@
+#if UNITY_EDITOR
+using UnityEditor;
+using UnityEngine;
+
+namespace DamageVolumeSystem.Editor
+{
+ [CustomEditor(typeof(DamageGenerator))]
+ public class DamageGeneratorEditor : UnityEditor.Editor
+ {
+ /*
+ * Editor page created by Mountools
+ * Author : WangSoul Team
+ * Date : 2026 / 05 / 09 - 16:20:21
+ */
+
+ public DamageGenerator damageGenerator;
+
+ private void OnEnable()
+ {
+ damageGenerator = (DamageGenerator) target;
+ }
+
+ private void DrawDamageGeneratorEditor()
+ {
+ if (GUILayout.Button("生成伤害"))
+ {
+ damageGenerator.Emit();
+ }
+ }
+
+ #region _
+
+ public override void OnInspectorGUI()
+ {
+ Undo.RecordObject(damageGenerator, "Edit DamageGenerator");
+ EditorGUI.BeginChangeCheck();
+
+ DrawDefaultInspector();
+ DrawDamageGeneratorEditor();
+
+ if (EditorGUI.EndChangeCheck())
+ {
+ EditorUtility.SetDirty(damageGenerator);
+ Undo.FlushUndoRecordObjects();
+ serializedObject.ApplyModifiedProperties();
+ }
+ }
+
+ private bool Property(string label, string propertyName, params GUILayoutOption[] options)
+ {
+ return EditorGUILayout.PropertyField(serializedObject.FindProperty(propertyName), new GUIContent(label), options);
+ }
+
+ #endregion
+ }
+}
+#endif \ No newline at end of file