Skip to content

Commit 11119f4

Browse files
authored
Merge pull request #159 from yhchen/master
GoWrapper set Flags.SkipBatching only target not null
2 parents 589bea7 + a7e2d6d commit 11119f4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Assets/Scripts/Core/GoWrapper.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected struct RendererInfo
3636
/// </summary>
3737
public GoWrapper()
3838
{
39-
_flags |= Flags.SkipBatching;
39+
// _flags |= Flags.SkipBatching;
4040

4141
_renderers = new List<RendererInfo>();
4242
_materialsBackup = new Dictionary<Material, Material>();
@@ -76,6 +76,10 @@ public void setWrapTarget(GameObject target, bool cloneMaterial)
7676
/// <param name="cloneMaterial">如果true,则复制材质,否则直接使用sharedMaterial。</param>
7777
public void SetWrapTarget(GameObject target, bool cloneMaterial)
7878
{
79+
// set Flags.SkipBatching only target not null
80+
if (target == null) _flags &= ~Flags.SkipBatching;
81+
else _flags |= Flags.SkipBatching;
82+
7983
RecoverMaterials();
8084

8185
_cloneMaterial = cloneMaterial;

0 commit comments

Comments
 (0)