소스 검색

拍照层级

zhaoyang 3 년 전
부모
커밋
de293439de
2개의 변경된 파일13개의 추가작업 그리고 3개의 파일을 삭제
  1. 13 0
      GameClient/Assets/Game/HotUpdate/DressUp/SceneController.cs
  2. 0 3
      GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

+ 13 - 0
GameClient/Assets/Game/HotUpdate/DressUp/SceneController.cs

@@ -192,6 +192,19 @@ namespace GFGGame
 
             parentGameObj.transform.SetParent(sceneObj.transform.Find("Scene"), false);
             DressUpUtil.AddItem(itemId, sceneObj, false, false, parentGameObj, resLayer);
+
+            if (parentGameObj.transform.childCount > 1)
+            {
+                if (resLayer == itemCfg.resLayer1)
+                {
+                    GameObject.DestroyImmediate(parentGameObj.transform.GetChild(1).gameObject);
+                }
+                else if (resLayer == itemCfg.resLayer2)
+                {
+                    GameObject.DestroyImmediate(parentGameObj.transform.GetChild(0).gameObject);
+                }
+            }
+
             SceneController.SetBoxCollider2DToGameObject(parentGameObj.transform.GetChild(0).gameObject);
         }
 

+ 0 - 3
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

@@ -243,9 +243,6 @@ namespace GFGGame
                 }
             }
 
-            // GameObject parentGameObj2;
-
-
         }
         /************************************************************场景*********************************************************/