重新导入obi

This commit is contained in:
2026-04-06 11:35:18 +08:00
parent 05fa2d6e5e
commit ae3002a0e2
1643 changed files with 232496 additions and 13 deletions

View File

@@ -0,0 +1,58 @@
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Collections;
using System;
namespace Obi
{
[CustomEditor(typeof(ObiRopeBlueprintBase), true)]
public class ObiRopeBaseBlueprintEditor : ObiActorBlueprintEditor
{
public override void OnEnable()
{
base.OnEnable();
Undo.undoRedoPerformed += UndoRedoPerformed;
}
public override void OnDisable()
{
base.OnDisable();
Undo.undoRedoPerformed -= UndoRedoPerformed;
}
void UndoRedoPerformed()
{
// Re-generate the blueprint after undo/redo.
if (blueprint != null)
blueprint.GenerateImmediate();
}
public override void OnInspectorGUI()
{
serializedObject.UpdateIfRequiredOrScript();
EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins);
Editor.DrawPropertiesExcluding(serializedObject, "m_Script");
EditorGUILayout.EndVertical();
if (GUI.changed)
{
serializedObject.ApplyModifiedProperties();
// Re-generate the blueprint if any element has been changed.
if (blueprint != null)
blueprint.GenerateImmediate();
// There might be blueprint editing operations that have no undo entry, so do this to
// ensure changes are serialized to disk by Unity.
EditorUtility.SetDirty(this);
}
}
}
}