/// <summary> 从GraphAsset中加载 </summary> public static BaseGraphWindow LoadGraphFromAsset(IGraphAsset _graphAsset) { BaseGraphWindow graphWindow = LoadGraph(_graphAsset.Graph); graphWindow.GraphAsset = _graphAsset as UnityObject; return(graphWindow); }
/// <summary> /// 跳转视图 /// </summary> /// <param name="graphAsset"></param> /// <returns></returns> public static BaseGraphWindow JumpTo(IGraphAsset graphAsset) { var window = GetGraphWindow(graphAsset.GraphType); window.jumpAssets.Add(window.GraphAsset); window.Load(graphAsset); return(window); }
public void Load(IGraphAsset asset) { if (asset == null) { return; } GraphAsset = asset; Reload(); }
// 从Graph资源加载 public void Load(IGraphAsset graphAsset) { Clear(); GraphAsset = graphAsset as UnityObject; CommandDispatcher = new CommandDispatcher(); InternalLoad(graphAsset.DeserializeGraph(), CommandDispatcher); }
/// <summary> 从GraphAsset打开Graph </summary> public static BaseGraphWindow Open(IGraphAsset graphAsset) { if (graphAsset == null) { return(null); } var window = GetGraphWindow(graphAsset.GraphType); window.Load(graphAsset); return(window); }
private void HandleBreadcrumbClick(int index) { _view.Save(); while (_graphs.Count > index) { _graphs.Pop(); _toolbarBreadcrumbs.PopItem(); } _current = _graphs.Peek(); LoadCurrent(); }
public static bool OnOpen(int instanceID, int line) { UnityObject go = EditorUtility.InstanceIDToObject(instanceID); if (go == null) { return(false); } IGraphAsset graphAsset = go as IGraphAsset; if (graphAsset == null) { return(false); } Open(graphAsset); return(true); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); if (!ContextDataCache.TryGetContextData <GUIStyle>("BigLabel", out var bigLabel)) { bigLabel.value = new GUIStyle(GUI.skin.label); bigLabel.value.fontSize = 18; bigLabel.value.fontStyle = FontStyle.Bold; bigLabel.value.alignment = TextAnchor.MiddleLeft; bigLabel.value.stretchWidth = true; } IGraphAsset graphAsset = target as IGraphAsset; if (GUILayout.Button("Open", GUILayout.Height(30))) { BaseGraphWindow.Open(target as InternalBaseGraphAsset); } }
internal void Load(IGraphAsset asset, bool nested = false) { if (asset == null) { return; } _view.Save(); if (!nested) { _graphs.Clear(); while (_toolbarBreadcrumbs.childCount > 0) { _toolbarBreadcrumbs.PopItem(); } } _current = asset; _graphs.Push(asset); int lastIndex = _graphs.Count; _toolbarBreadcrumbs.PushItem(_current.name, () => { HandleBreadcrumbClick(lastIndex); }); LoadCurrent(); }
public void Load(IGraphAsset asset) { }
public static void Open(IGraphAsset asset, bool nested = false) { GetOrCreate().Load(asset, nested); }
public void Load(IGraphAsset asset) { CreateGridBackground(); }