您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
41 行
889 B
41 行
889 B
using System;
|
|
using RMGUI.GraphView;
|
|
using UnityEngine;
|
|
using UnityEngine.Graphing;
|
|
|
|
namespace UnityEditor.Graphing.Drawing
|
|
{
|
|
public class HeaderDrawData : GraphElementPresenter
|
|
{
|
|
protected HeaderDrawData()
|
|
{}
|
|
|
|
private INode node;
|
|
|
|
[SerializeField] private bool m_Expanded;
|
|
|
|
public string title
|
|
{
|
|
get { return node.name; }
|
|
}
|
|
|
|
public bool expanded
|
|
{
|
|
get { return m_Expanded; }
|
|
set
|
|
{
|
|
var state = node.drawState;
|
|
state.expanded = value;
|
|
node.drawState = state;
|
|
m_Expanded = value;
|
|
}
|
|
}
|
|
|
|
public void Initialize(INode inNode)
|
|
{
|
|
node = inNode;
|
|
name = inNode.name + " Header";
|
|
m_Expanded = node.drawState.expanded;
|
|
}
|
|
}
|
|
}
|