浏览代码

回收预制体前清空targetTexture

leiyasi 1 年之前
父节点
当前提交
3e44069981
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryDialogView.cs

+ 4 - 0
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryDialogView.cs

@@ -1026,12 +1026,16 @@ namespace GFGGame
 
 
         private void DestroyHeadImg()
         private void DestroyHeadImg()
         {
         {
+            _dressUpSceneObj.transform.Find("Camera").GetComponent<Camera>().targetTexture = null;
+
+            // 回收RawImage
             if (_selfHeadImgObj != null)
             if (_selfHeadImgObj != null)
             {
             {
                 PrefabManager.Instance.Restore(_selfHeadImgObj);
                 PrefabManager.Instance.Restore(_selfHeadImgObj);
                 _selfHeadImgObj = null;
                 _selfHeadImgObj = null;
             }
             }
 
 
+            // 回收相机预制
             if (_dressUpSceneObj != null)
             if (_dressUpSceneObj != null)
             {
             {
                 PrefabManager.Instance.Restore(_dressUpSceneObj);
                 PrefabManager.Instance.Restore(_dressUpSceneObj);