您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

37 行
937 B

using UnityEngine.RMGUI;
using UnityEngine.RMGUI.StyleEnums.Values;
namespace RMGUI.GraphView.Demo
{
// TODO: shanti really there should be one data type on a delegate. ... seriously
[CustomDataView(typeof(IMGUIData))]
[CustomDataView(typeof(TestIMGUIElementData))]
[CustomDataView(typeof(IMGUISampleElementData))]
public class IMGUIElement : SimpleElement
{
public IMGUIElement()
{
var imgui = new IMGUIContainer()
{
positionType = PositionType.Absolute,
positionLeft = 0,
positionTop = 20,
positionRight = 0,
positionBottom = 0,
OnGUIHandler = OnGUIHandler
};
AddChild(imgui);
}
public virtual void OnGUIHandler()
{
// Hum... probably not ideal to have to cast and check all the time. Need to find something better.
var imguiData = dataProvider as IMGUIData;
if (imguiData != null)
{
imguiData.OnGUIHandler();
}
}
}
}