소스 검색

抽卡特效

zhaoyang 3 년 전
부모
커밋
159d44a213
1개의 변경된 파일20개의 추가작업 그리고 14개의 파일을 삭제
  1. 20 14
      GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxStarView.cs

+ 20 - 14
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxStarView.cs

@@ -80,20 +80,22 @@ namespace GFGGame
                 comStar.m_imgLine.width = imgLineWidth;
                 comStar.m_imgLine.rotation = 0;
 
-                GameObject gameObject = _gameObjects.Count > index ? _gameObjects[index] : null;
-                GoWrapper wrapper = _wrappers.Count > index ? _wrappers[index] : null;
-                string resPath = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck");
-                SceneController.AddObjectToView(gameObject, wrapper, comStar.m_holder, resPath, out gameObject, out wrapper);
-                if (_gameObjects.Count <= index) _gameObjects.Add(gameObject);
-                if (_wrappers.Count <= index) _wrappers.Add(wrapper);
-
-                GameObject gameObject1 = _gameObjects1.Count > index ? _gameObjects1[index] : null;
-                GoWrapper wrapper1 = _wrappers1.Count > index ? _wrappers1[index] : null;
-                string resPath1 = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck_dj");
-                SceneController.AddObjectToView(gameObject1, wrapper1, comStar.m_holder1, resPath1, out gameObject1, out wrapper1);
-                if (_gameObjects1.Count <= index) _gameObjects1.Add(gameObject);
-                if (_wrappers1.Count <= index) _wrappers1.Add(wrapper);
-
+                if (_gameObjects.Count <= index)
+                {
+                    GameObject gameObject = _gameObjects.Count > index ? _gameObjects[index] : null;
+                    GoWrapper wrapper = _wrappers.Count > index ? _wrappers[index] : null;
+                    string resPath = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck");
+                    SceneController.AddObjectToView(gameObject, wrapper, comStar.m_holder, resPath, out gameObject, out wrapper);
+                    _gameObjects.Add(gameObject);
+                    _wrappers.Add(wrapper);
+
+                    GameObject gameObject1 = _gameObjects1.Count > index ? _gameObjects1[index] : null;
+                    GoWrapper wrapper1 = _wrappers1.Count > index ? _wrappers1[index] : null;
+                    string resPath1 = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck_dj");
+                    SceneController.AddObjectToView(gameObject1, wrapper1, comStar.m_holder1, resPath1, out gameObject1, out wrapper1);
+                    _gameObjects1.Add(gameObject);
+                    _wrappers1.Add(wrapper);
+                }
                 star.data = new Vector2(comStar.target.x, comStar.target.y);
                 comStars.Add(star);
 
@@ -217,6 +219,10 @@ namespace GFGGame
         protected override void OnHide()
         {
             base.OnHide();
+            _gameObjects.Clear();
+            _wrappers.Clear();
+            _gameObjects1.Clear();
+            _wrappers1.Clear();
         }
     }
 }