protected internal override void Invalidate(VFXModel model, InvalidationCause cause) { if (cause == InvalidationCause.kSettingChanged) { var graph = GetGraph(); if (graph != null && subgraph != null && m_Subgraph.GetResource() != null) { var otherGraph = m_Subgraph.GetResource().GetOrCreateGraph(); if (otherGraph == graph || otherGraph.subgraphDependencies.Contains(graph.GetResource().visualEffectObject)) { m_Subgraph = null; // prevent cyclic dependencies. } if (otherGraph != m_UsedSubgraph) { RecreateCopy(); } if (graph.GetResource().isSubgraph) // BuildSubgraphDependencies is called for vfx by recompilation, but in subgraph we must call it explicitely { graph.BuildSubgraphDependencies(); } } else if (m_UsedSubgraph != null) { RecreateCopy(); } } base.Invalidate(model, cause); }
private static extern void CreateVisualEffectSubgraph([Writable] VisualEffectSubgraphBlock subGraph);