-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestWindow.cs
More file actions
42 lines (38 loc) · 980 Bytes
/
TestWindow.cs
File metadata and controls
42 lines (38 loc) · 980 Bytes
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
using DG.Tweening.Core;
using UnityEditor;
using UnityEditor.UI;
namespace Emmy.self_ui
{
public class TestWindow:MyWindow
{
private static TestWindow _window;
[MenuItem("Window/测试功能")]
private static void ShowWindow()
{
if (_window == null)
{
_window = CreateInstance<TestWindow>();
}
_window.Show();
}
private DisplayObject tf;
public TestWindow()
{
var sp = new Sprite();
var tf = new TextField("hello world");
sp.AddChild(tf);
tf.X = 0;
tf.Y = 100;
tf.Width = 100;
tf.Height = 100;
this.AddChild(sp);
sp.X = 100;
// sp.Y = 0;
// sp.Width = 0;
// sp.Height = 0;
var button = new Button("test");
button.Y = 100;
sp.AddChild(button);
}
}
}