bool CheckSelectedObject()
{
if (Selection.activeObject == null || !(Selection.activeObject is ScriptableObject))
{
return(false);
}
ScriptableObject so = Selection.activeObject as ScriptableObject;
graphList = new Dictionary <string, GraphData>();
foreach (FieldInfo fieldInfo in so.GetType().GetFields())
{
GraphData data;
if (GraphData.CanCreateGraphData(so, fieldInfo, out data))
{
string uniqueName = data.PropertyName;
int i = 0;
while (graphList.Keys.Contains(uniqueName))
{
uniqueName = data.PropertyName + " [" + (++i) + "]";
}
graphList.Add(uniqueName, data);
}
}
//return nodes.Count > 0;
return(true);
}