summaryrefslogtreecommitdiff
path: root/Assets/ActionTool/Editor/ActionColliderEditor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/ActionTool/Editor/ActionColliderEditor.cs')
-rw-r--r--Assets/ActionTool/Editor/ActionColliderEditor.cs40
1 files changed, 29 insertions, 11 deletions
diff --git a/Assets/ActionTool/Editor/ActionColliderEditor.cs b/Assets/ActionTool/Editor/ActionColliderEditor.cs
index 57c060fa..0c312806 100644
--- a/Assets/ActionTool/Editor/ActionColliderEditor.cs
+++ b/Assets/ActionTool/Editor/ActionColliderEditor.cs
@@ -9,18 +9,29 @@ namespace ActionTool
// 编辑collider帧
public class ActionColliderEditor : EditorWindow
{
+ EditorWindow sceneView;
private void OnEnable()
{
- titleContent = new GUIContent("Collider Editor");
- }
+ titleContent = new GUIContent("Collider Editor");
+ maxSize = new Vector2(300, 150);
+ minSize = maxSize;
- private void OnDisable()
+ if(!sceneView)
+ sceneView = EditorWindow.GetWindow<SceneView>();
+ }
+
+ private void OnDisable()
{
- ActionManager.OnSelectColliderFrame(null);
+ // sceneView = null;
+ ActionManager.OnSelectColliderFrame(null);
}
- private void OnGUI()
+ private void Update()
+ {
+ }
+
+ private void OnGUI()
{
var frame = ActionManager.editColliderFrame;
if (frame == null)
@@ -29,12 +40,11 @@ namespace ActionTool
return;
}
- Rect pos = position;
- pos.width = 300;
- pos.height = 150;
- position = pos;
+ GUI.changed = false;
- EditorGUILayout.BeginHorizontal();
+ GUILayout.Space(5);
+
+ EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField("frame: ");
EditorGUILayout.LabelField(frame.frame.ToString());
EditorGUILayout.EndHorizontal();
@@ -59,6 +69,14 @@ namespace ActionTool
ActionManager.DeleteCurFrame();
}
GUI.color = prevColor;
+
+ if (GUI.changed)
+ {
+ if (sceneView != null)
+ sceneView.Repaint();
+ if (ActionManager.PreviewWindow != null)
+ ActionManager.PreviewWindow.Repaint();
+ }
}
}
-} \ No newline at end of file
+} \ No newline at end of file