|
|
|
|
|
|
|
|
|
|
namespace UnityEditor.Graphing.Drawing |
|
|
|
{ |
|
|
|
class GraphEditWindow : EditorWindow |
|
|
|
public class GraphEditWindow : AbstractGraphEditWindow<SerializableGraphAsset> |
|
|
|
{ |
|
|
|
[MenuItem("Window/Graph Editor")] |
|
|
|
public static void OpenMenu() |
|
|
|
|
|
|
} |
|
|
|
public abstract class AbstractGraphEditWindow<T> : EditorWindow where T : ScriptableObject, IGraphAsset |
|
|
|
{ |
|
|
|
private SerializableGraphAsset m_LastSelection; |
|
|
|
private T m_LastSelection; |
|
|
|
|
|
|
|
[NonSerialized] |
|
|
|
private Canvas2D m_Canvas; |
|
|
|
|
|
|
{ |
|
|
|
get |
|
|
|
{ |
|
|
|
return m_LastSelection != null && m_LastSelection.graph != null; |
|
|
|
return m_LastSelection != null && m_LastSelection.shouldRepaint; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
if (Selection.activeObject == null || !EditorUtility.IsPersistent(Selection.activeObject)) |
|
|
|
return; |
|
|
|
|
|
|
|
if (Selection.activeObject is SerializableGraphAsset) |
|
|
|
if (Selection.activeObject is T) |
|
|
|
var selection = (SerializableGraphAsset) Selection.activeObject; |
|
|
|
var selection = (T) Selection.activeObject; |
|
|
|
if (selection != m_LastSelection) |
|
|
|
{ |
|
|
|
m_LastSelection = selection; |
|
|
|
|
|
|
EditorGUILayout.EndHorizontal(); |
|
|
|
}*/ |
|
|
|
} |
|
|
|
|
|
|
|
} |