示例#1
0
        void Update()
        {
            if (graphView == null)
            {
                return;
            }
            VFXViewController controller = graphView.controller;
            var filename = "No Asset";

            if (controller != null)
            {
                controller.NotifyUpdate();
                if (controller.model != null)
                {
                    var graph = controller.graph;
                    if (graph != null)
                    {
                        filename = controller.name;

                        if (!graph.saved)
                        {
                            filename += "*";
                        }


                        graph.RecompileIfNeeded(!autoCompile);
                        controller.RecompileExpressionGraphIfNeeded();
                    }
                }
            }
            titleContent.text = filename;
        }
        void Update()
        {
            if (graphView == null)
            {
                return;
            }

            if (m_OnUpdateAction != null)
            {
                m_OnUpdateAction();
                m_OnUpdateAction = null;
            }
            VFXViewController controller = graphView.controller;
            var filename = "No Asset";

            if (controller != null)
            {
                controller.NotifyUpdate();
                if (controller.model != null)
                {
                    var graph = controller.graph;
                    if (graph != null)
                    {
                        filename = controller.name;

                        if (!graph.saved)
                        {
                            filename += "*";
                        }


                        graph.RecompileIfNeeded(!autoCompile, !autoCompileDependent);
                        controller.RecompileExpressionGraphIfNeeded();
                    }
                }
            }

            if (VFXViewModicationProcessor.assetMoved)
            {
                graphView.AssetMoved();
                VFXViewModicationProcessor.assetMoved = false;
            }
            titleContent.text = filename;

            if (graphView?.controller?.model?.visualEffectObject != null)
            {
                graphView.checkoutButton.visible = true;
                if (!AssetDatabase.IsOpenForEdit(graphView.controller.model.visualEffectObject,
                                                 StatusQueryOptions.UseCachedIfPossible) && Provider.isActive && Provider.enabled)
                {
                    graphView.checkoutButton.SetEnabled(true);
                }
                else
                {
                    graphView.checkoutButton.SetEnabled(false);
                }
            }
        }
        void Update()
        {
            if (graphView == null)
            {
                return;
            }

            if (m_OnUpdateAction != null)
            {
                m_OnUpdateAction();
                m_OnUpdateAction = null;
            }
            VFXViewController controller = graphView.controller;
            var filename = "No Asset";

            if (controller != null)
            {
                controller.NotifyUpdate();
                if (controller.model != null)
                {
                    var graph = controller.graph;
                    if (graph != null)
                    {
                        filename = controller.name;

                        if (!graph.saved)
                        {
                            filename += "*";
                        }


                        graph.RecompileIfNeeded(!autoCompile, !autoCompileDependent);
                        controller.RecompileExpressionGraphIfNeeded();
                    }
                }
            }

            if (VFXViewModicationProcessor.assetMoved)
            {
                graphView.AssetMoved();
                VFXViewModicationProcessor.assetMoved = false;
            }
            titleContent.text = filename;
        }
示例#4
0
        void Update()
        {
            if (graphView == null)
            {
                return;
            }

            if (m_OnUpdateAction != null)
            {
                m_OnUpdateAction();
                m_OnUpdateAction = null;
            }
            VFXViewController controller = graphView.controller;
            var filename = "No Asset";

            if (controller != null)
            {
                controller.NotifyUpdate();
                if (controller.model != null)
                {
                    var graph = controller.graph;
                    if (graph != null)
                    {
                        filename = controller.name;

                        if (!graph.saved)
                        {
                            filename += "*";
                        }
                        if (autoCompile && graph.IsExpressionGraphDirty() && !graph.GetResource().isSubgraph)
                        {
                            VFXGraph.explicitCompile = true;
                            graph.errorManager.ClearAllErrors(null, VFXErrorOrigin.Compilation);
                            using (var reporter = new VFXCompileErrorReporter(controller.graph.errorManager))
                            {
                                VFXGraph.compileReporter = reporter;
                                AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(graphView.controller.model));
                                VFXGraph.compileReporter = null;
                            }
                            VFXGraph.explicitCompile = false;
                        }
                        else
                        {
                            graph.RecompileIfNeeded(true, true);
                        }

                        bool wasDirty = graph.IsExpressionGraphDirty();

                        controller.RecompileExpressionGraphIfNeeded();

                        // Hack to avoid infinite recompilation due to UI triggering a recompile TODO: Fix problematic cases that trigger that error
                        if (!wasDirty && graph.IsExpressionGraphDirty())
                        {
                            Debug.LogError("Expression graph was marked as dirty after compiling context for UI. Discard to avoid infinite compilation loop.");
                            graph.SetExpressionGraphDirty(false);
                        }
                    }
                }
            }

            if (VFXViewModificationProcessor.assetMoved)
            {
                graphView.AssetMoved();
                VFXViewModificationProcessor.assetMoved = false;
            }
            titleContent.text = filename;

            if (graphView?.controller?.model?.visualEffectObject != null)
            {
                graphView.checkoutButton.visible = true;
                if (!AssetDatabase.IsOpenForEdit(graphView.controller.model.visualEffectObject,
                                                 StatusQueryOptions.UseCachedIfPossible) && Provider.isActive && Provider.enabled)
                {
                    graphView.checkoutButton.SetEnabled(true);
                }
                else
                {
                    graphView.checkoutButton.SetEnabled(false);
                }
            }
        }
示例#5
0
        void Update()
        {
            if (graphView == null)
            {
                return;
            }

            if (m_OnUpdateAction != null)
            {
                m_OnUpdateAction();
                m_OnUpdateAction = null;
            }
            VFXViewController controller = graphView.controller;
            var filename = "No Asset";

            if (controller != null)
            {
                controller.NotifyUpdate();
                if (controller.model != null)
                {
                    var graph = controller.graph;
                    if (graph != null)
                    {
                        filename = controller.name;

                        if (!graph.saved)
                        {
                            filename += "*";
                        }
                        if (autoCompile && graph.IsExpressionGraphDirty() && !graph.GetResource().isSubgraph)
                        {
                            VFXGraph.explicitCompile = true;
                            graph.errorManager.ClearAllErrors(null, VFXErrorOrigin.Compilation);
                            using (var reporter = new VFXCompileErrorReporter(controller.graph.errorManager))
                            {
                                VFXGraph.compileReporter = reporter;
                                AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(graphView.controller.model));
                                VFXGraph.compileReporter = null;
                            }
                            VFXGraph.explicitCompile = false;
                        }
                        else
                        {
                            graph.RecompileIfNeeded(true, true);
                        }

                        controller.RecompileExpressionGraphIfNeeded();
                    }
                }
            }

            if (VFXViewModicationProcessor.assetMoved)
            {
                graphView.AssetMoved();
                VFXViewModicationProcessor.assetMoved = false;
            }
            titleContent.text = filename;

            if (graphView?.controller?.model?.visualEffectObject != null)
            {
                graphView.checkoutButton.visible = true;
                if (!AssetDatabase.IsOpenForEdit(graphView.controller.model.visualEffectObject,
                                                 StatusQueryOptions.UseCachedIfPossible) && Provider.isActive && Provider.enabled)
                {
                    graphView.checkoutButton.SetEnabled(true);
                }
                else
                {
                    graphView.checkoutButton.SetEnabled(false);
                }
            }
        }