Skip to content

Commit 85e6af2

Browse files
iTris666GitHub Enterprise
authored andcommitted
Make sure m_DependentDirty is flagged when the strutu change because kExpressionGraphChanged is not send for subgraphs. Cleanup (#121)
1 parent 368fc26 commit 85e6af2

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
@@ -470,11 +470,14 @@ protected override void OnInvalidate(VFXModel model, VFXModel.InvalidationCause
470470
UpdateSubAssets();
471471
if (model == this)
472472
VFXSubgraphContext.CallOnGraphChanged(this);
473+
474+
m_DependentDirty = true;
473475
}
474476

475477
if (cause == VFXModel.InvalidationCause.kSettingChanged && model is VFXParameter)
476478
{
477479
VFXSubgraphContext.CallOnGraphChanged(this);
480+
m_DependentDirty = true;
478481
}
479482

480483
if (cause != VFXModel.InvalidationCause.kExpressionInvalidated &&
@@ -803,15 +806,12 @@ public void RecompileIfNeeded(bool preventRecompilation = false, bool preventDep
803806
}
804807
if (!preventDependencyRecompilation && m_DependentDirty)
805808
{
806-
if (m_DependentDirty)
809+
var obj = GetResource().visualEffectObject;
810+
foreach (var graph in GetAllGraphs<VisualEffectAsset>())
807811
{
808-
var obj = GetResource().visualEffectObject;
809-
foreach (var graph in GetAllGraphs<VisualEffectAsset>())
810-
{
811-
graph.SubgraphDirty(obj);
812-
}
813-
m_DependentDirty = false;
812+
graph.SubgraphDirty(obj);
814813
}
814+
m_DependentDirty = false;
815815
}
816816
}
817817

0 commit comments

Comments
 (0)