소스 검색

回收预制体前清空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()
         {
+            _dressUpSceneObj.transform.Find("Camera").GetComponent<Camera>().targetTexture = null;
+
+            // 回收RawImage
             if (_selfHeadImgObj != null)
             {
                 PrefabManager.Instance.Restore(_selfHeadImgObj);
                 _selfHeadImgObj = null;
             }
 
+            // 回收相机预制
             if (_dressUpSceneObj != null)
             {
                 PrefabManager.Instance.Restore(_dressUpSceneObj);