Пример #1
0
        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);
        }
Пример #2
0
 internal void LoadAsset(UdonGraphProgramAsset asset)
 {
     _graphAsset             = asset;
     _graphAsset.OnAssemble += OnAssemble;
     _programSourceView.LoadAsset(asset);
 }
Пример #3
0
 public UdonGraphData GetGraphDataFromAsset(UdonGraphProgramAsset asset)
 {
     InitializeGraph(asset);
                     return(_graphView.graphData);
 }
Пример #4
0
 public void LoadAsset(UdonGraphProgramAsset asset)
 {
     _asset = asset;
 }