File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments