コード例 #1
0
        protected override void ModelChanged(UnityEngine.Object obj)
        {
            Profiler.BeginSample("VFXDataAnchorController.ModelChanged");
            if (expandedSelf != m_Expanded)
            {
                m_Expanded = expandedSelf;
                UpdateHiddenRecursive(m_Hidden, true);
            }
            Profiler.BeginSample("VFXDataAnchorController.ModelChanged:UpdateInfos");
            UpdateInfos();
            Profiler.EndSample();

            // This method is called every time a value change in the expression which is way to often
            // Currently we only want to refresh the gizmo when the expression change (especially when space or "can evaluate" change)
            // That's why we cache the expression hash code
            if (m_GizmoContext != null)
            {
                HashSet <VFXExpression> expressions = new HashSet <VFXExpression>();
                model.GetExpressions(expressions);

                var currentExpressionHashCode = UIUtilities.GetHashCode(expressions);
                if (currentExpressionHashCode != m_expressionHashCode)
                {
                    RefreshGizmo();
                    m_expressionHashCode = currentExpressionHashCode;
                }
            }

            sourceNode.DataEdgesMightHaveChanged();

            Profiler.BeginSample("VFXDataAnchorController.NotifyChange");
            NotifyChange(AnyThing);
            Profiler.EndSample();
            Profiler.EndSample();
        }