public void InitializeGraph(UdonGraphProgramAsset graph, UdonBehaviour udonBehaviour = null) { this._graphAsset = graph; InitializeWindow(); _graphView = _rootView.Children().FirstOrDefault(e => e is UdonGraph) as UdonGraph; if (_graphView == null) { Debug.LogError("GraphView has not been added to the BaseGraph root view!"); return; } _graphView.Initialize(graph, udonBehaviour); _graphStatus.LoadAsset(graph); // Store GUID for this asset to settings for easy reload later if (AssetDatabase.TryGetGUIDAndLocalFileIdentifier(graph, out string guid, out long localId)) { Settings.LastGraphGuid = guid; } if (udonBehaviour != null) { Settings.LastUdonBehaviourPath = udonBehaviour.transform.GetHierarchyPath(); Settings.LastUdonBehaviourScenePath = udonBehaviour.gameObject.scene.path; } _graphAssetName.text = graph.name; ShowGraphTools(true); }
internal void LoadAsset(UdonGraphProgramAsset asset) { _graphAsset = asset; _graphAsset.OnAssemble += OnAssemble; _programSourceView.LoadAsset(asset); }
public UdonGraphData GetGraphDataFromAsset(UdonGraphProgramAsset asset) { InitializeGraph(asset); return(_graphView.graphData); }
public void LoadAsset(UdonGraphProgramAsset asset) { _asset = asset; }