Skip to content

Commit 6185da1

Browse files
iTris666julienf-unity
authored andcommitted
Make sure m_DependentDirty is flagged when the strutu change because kExpressionGraphChanged is not send for subgraphs. Cleanup (#121)
1 parent 683dde3 commit 6185da1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

com.unity.visualeffectgraph/Editor/Models/VFXGraph.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,14 @@ protected override void OnInvalidate(VFXModel model, VFXModel.InvalidationCause
424424
UpdateSubAssets();
425425
if (model == this)
426426
VFXSubgraphContext.CallOnGraphChanged(this);
427+
428+
m_DependentDirty = true;
427429
}
428430

429431
if (cause == VFXModel.InvalidationCause.kSettingChanged && model is VFXParameter)
430432
{
431433
VFXSubgraphContext.CallOnGraphChanged(this);
434+
m_DependentDirty = true;
432435
}
433436

434437
if (cause != VFXModel.InvalidationCause.kExpressionInvalidated &&
@@ -753,15 +756,12 @@ public void RecompileIfNeeded(bool preventRecompilation = false, bool preventDep
753756
}
754757
if (!preventDependencyRecompilation && m_DependentDirty)
755758
{
756-
if (m_DependentDirty)
759+
var obj = GetResource().visualEffectObject;
760+
foreach (var graph in GetAllGraphs<VisualEffectAsset>())
757761
{
758-
var obj = GetResource().visualEffectObject;
759-
foreach (var graph in GetAllGraphs<VisualEffectAsset>())
760-
{
761-
graph.SubgraphDirty(obj);
762-
}
763-
m_DependentDirty = false;
762+
graph.SubgraphDirty(obj);
764763
}
764+
m_DependentDirty = false;
765765
}
766766
}
767767

0 commit comments

Comments
 (0)