gewentao
6 年前
当前提交
25b32e04
共有 14 个文件被更改,包括 176 次插入 和 82 次删除
-
5Assets/UIWidgets/Tests/Menu.cs
-
7Assets/UIWidgets/painting/decoration_image.cs
-
14Assets/UIWidgets/painting/image_provider.cs
-
16Assets/UIWidgets/rendering/image.cs
-
1Assets/UIWidgets/ui/painting/canvas.cs
-
6Assets/UIWidgets/ui/painting/canvas_impl.cs
-
1Assets/UIWidgets/ui/painting/draw_cmd.cs
-
6Assets/UIWidgets/ui/painting/picture.cs
-
23Assets/UIWidgets/widgets/basic.cs
-
37Assets/UIWidgets/widgets/binding.cs
-
35Assets/UIWidgets/widgets/container.cs
-
43Assets/UIWidgets/widgets/image.cs
-
61Assets/UIWidgets/Tests/Widgets.cs
-
3Assets/UIWidgets/Tests/Widgets.cs.meta
|
|||
using UIWidgets.painting; |
|||
using UIWidgets.editor; |
|||
using UIWidgets.widgets; |
|||
using UnityEditor; |
|||
using UnityEngine; |
|||
|
|||
namespace UIWidgets.Tests { |
|||
public class Widgets : EditorWindow { |
|||
private WindowAdapter windowAdapter; |
|||
|
|||
private WidgetsBindings widgetsBindings; |
|||
|
|||
private PaintingBinding paintingBinding; |
|||
|
|||
private Widget root; |
|||
|
|||
private Widget image; |
|||
|
|||
Widgets() { |
|||
this.titleContent = new GUIContent("Widgets Test"); |
|||
this.image = new widgets.Image( |
|||
"https://tse3.mm.bing.net/th?id=OIP.XOAIpvR1kh-CzISe_Nj9GgHaHs&pid=Api", |
|||
width: 100, |
|||
height: 100 |
|||
); |
|||
this.root = new widgets.Container( |
|||
width: 200, |
|||
height: 200, |
|||
margin: EdgeInsets.all(30.0), |
|||
child: image |
|||
); |
|||
} |
|||
|
|||
void OnGUI() { |
|||
if (this.windowAdapter != null) { |
|||
this.windowAdapter.OnGUI(); |
|||
} |
|||
} |
|||
|
|||
private void Update() { |
|||
if (this.windowAdapter != null) { |
|||
this.windowAdapter.Update(); |
|||
} |
|||
} |
|||
|
|||
private void OnEnable() { |
|||
this.paintingBinding = new PaintingBinding(null); |
|||
paintingBinding.initInstances(); |
|||
this.windowAdapter = new WindowAdapter(this); |
|||
this.widgetsBindings = new WidgetsBindings(windowAdapter); |
|||
if (widgetsBindings != null) { |
|||
widgetsBindings.attachRootWidget(root); |
|||
} |
|||
} |
|||
|
|||
void OnDestroy() { |
|||
this.windowAdapter = null; |
|||
this.widgetsBindings = null; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 1d2e1850f336481aa984d96b28c513b2 |
|||
timeCreated: 1536916429 |
撰写
预览
正在加载...
取消
保存
Reference in new issue