您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
31 行
716 B
31 行
716 B
using UnityEngine;
|
|
using UnityEngine.RMGUI;
|
|
|
|
namespace RMGUI.GraphView.Demo
|
|
{
|
|
[GUISkinStyle("window")]
|
|
[CustomDataView(typeof(SimpleElementData))]
|
|
public class SimpleElement : GraphElement
|
|
{
|
|
public SimpleElement()
|
|
{
|
|
content = new GUIContent("");
|
|
}
|
|
|
|
public override void DoRepaint(PaintContext painter)
|
|
{
|
|
base.DoRepaint(painter);
|
|
if (GetData<GraphElementData>() != null && GetData<GraphElementData>().selected)
|
|
{
|
|
painter.DrawRectangleOutline(transform, position, Color.yellow);
|
|
}
|
|
}
|
|
|
|
public override void OnDataChanged()
|
|
{
|
|
base.OnDataChanged();
|
|
var elementData = (SimpleElementData)dataProvider;
|
|
content.text = elementData.title;
|
|
}
|
|
}
|
|
}
|