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

57 行
1.0 KiB

using System;
using System.Collections.Generic;
using UnityEngine;
namespace RMGUI.GraphView
{
[Serializable]
public abstract class GraphElementData : ScriptableObject
{
[SerializeField]
private bool m_Selected;
[SerializeField]
private Rect m_Position;
[SerializeField]
private Capabilities m_Capabilities;
public Rect position
{
get { return m_Position; }
set { m_Position = value; }
}
public bool selected
{
get { return m_Selected; }
set
{
// Set new value (toggle old value)
if ((capabilities & Capabilities.Selectable) == Capabilities.Selectable)
{
m_Selected = value;
}
}
}
protected void OnEnable()
{
capabilities = Capabilities.Normal | Capabilities.Movable | Capabilities.Selectable;
}
public virtual IEnumerable<GraphElementData> elements
{
get { return new GraphElementData[0]; }
}
public Capabilities capabilities
{
get { return m_Capabilities; }
set { m_Capabilities = value; }
}
public virtual void CommitChanges()
{}
}
}