blob: 0d4a0f4fb0046676f940ed61a6e28bc0b500e964 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace ActionTool
{
// 编辑collider帧
public class ActionInfoEditor : EditorWindow
{
private static string title;
private static string content;
private static Vector2 size;
public static void ShowContent(string tlt, string cnt)
{
title = tlt;
content = cnt;
size = GUI.skin.label.CalcSize(new GUIContent(content));
var editor = EditorWindow.GetWindow<ActionInfoEditor>(true);
editor.titleContent = new GUIContent(title);
editor.OnEnable();
}
private void OnEnable()
{
titleContent = new GUIContent(title);
maxSize = new Vector2(50 + size.x, 10 + size.y);
minSize = maxSize;
}
private void OnDisable()
{
}
private void Update()
{
}
private void OnGUI()
{
Vector2 size= GUI.skin.label.CalcSize(new GUIContent(content));
GUI.Label(new Rect(5,5, size.x, size.y), content);
}
}
}
|