Skip to content

Commit cd7afae

Browse files
committed
兼容2018
1 parent 528cc39 commit cd7afae

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Editor/ParticleSystemGameObjectEditor.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public override void OnPreviewGUI(Rect r, GUIStyle background)
128128
}
129129
else
130130
{
131-
s_TargetIndexPropertyInfo.SetValue(baseEditor, s_TargetIndexPropertyInfo.GetValue(this));
131+
SetEditorTargetIndex();
132132
baseEditor.OnPreviewGUI(r, background);
133133
}
134134
}
@@ -141,7 +141,7 @@ public override void OnInteractivePreviewGUI(Rect r, GUIStyle background)
141141
}
142142
else
143143
{
144-
s_TargetIndexPropertyInfo.SetValue(baseEditor, s_TargetIndexPropertyInfo.GetValue(this));
144+
SetEditorTargetIndex();
145145
baseEditor.OnInteractivePreviewGUI(r, background);
146146
}
147147
}
@@ -218,5 +218,11 @@ private bool IsPreviewCacheNotNull
218218
return false;
219219
}
220220
}
221+
222+
private void SetEditorTargetIndex()
223+
{
224+
var newVal = s_TargetIndexPropertyInfo.GetValue(this, null);
225+
s_TargetIndexPropertyInfo.SetValue(baseEditor, newVal, null);
226+
}
221227
}
222228
}

0 commit comments

Comments
 (0)