Procházet zdrojové kódy

特效修改调用方式

huangxiaoyue před 2 roky
rodič
revize
bf18880b90

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/CommonGame/RewardView.cs

@@ -120,7 +120,7 @@ namespace GFGGame
             item.m_comRewardItem.m_loaIcon.url = ResPathUtil.GetIconPath(iconRes, ext);
 
             item.m_comRewardItem.m_imgOnceBonus.visible = _listItemDatas[index].isOnceBonus;
-            string resPath = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck_zl");
+            //string resPath = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck_zl");
             int childIndex = _ui.m_comListReward.m_listReward.ItemIndexToChildIndex(index);
             if (_effects.Count <= childIndex)
             {

+ 27 - 35
GameClient/Assets/Game/HotUpdate/Views/DailyWelfare/DailySignView.cs

@@ -12,18 +12,13 @@ namespace GFGGame
     public class DailySignView : BaseWindow
     {
         private UI_DailySignUI _ui;
-        private GameObject _gameObject0;
-        private GameObject _gameObject1;
-        private GameObject _gameObject2;
-        private GameObject _gameObject3;
-        private GameObject _gameObject4;
-        private GameObject _gameObject5;
-        private GoWrapper _wrapper0;
-        private GoWrapper _wrapper1;
-        private GoWrapper _wrapper2;
-        private GoWrapper _wrapper3;
-        private GoWrapper _wrapper4;
-        private GoWrapper _wrapper5;
+        private EffectUI _effectUI0;
+        private EffectUI _effectUI1;
+        private EffectUI _effectUI2;
+        private EffectUI _effectUI3;
+        private EffectUI _effectUI4;
+        private EffectUI _effectUI5;
+
         private GGraph m_holderSign;
         private float _signCount;
         private int _month;
@@ -32,12 +27,18 @@ namespace GFGGame
         public override void Dispose()
         {
             base.Dispose();
-            SceneController.DestroyObjectFromView(_gameObject0, _wrapper0);
-            SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
-            SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
-            SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
-            SceneController.DestroyObjectFromView(_gameObject4, _wrapper4);
-            SceneController.DestroyObjectFromView(_gameObject5, _wrapper5);
+            EffectUIPool.Recycle(_effectUI0);
+            _effectUI0 = null;
+            EffectUIPool.Recycle(_effectUI1);
+            _effectUI1 = null;
+            EffectUIPool.Recycle(_effectUI2);
+            _effectUI2 = null;
+            EffectUIPool.Recycle(_effectUI3);
+            _effectUI3 = null;
+            EffectUIPool.Recycle(_effectUI4);
+            _effectUI4 = null;
+            EffectUIPool.Recycle(_effectUI5);
+            _effectUI5 = null;
             if (_ui != null)
             {
                 _ui.Dispose();
@@ -58,17 +59,10 @@ namespace GFGGame
             _ui.m_btnClose.onClick.Add(Hide);
             _ui.m_list.itemRenderer = ListItemRender;
 
-
-            string resPath = ResPathUtil.GetViewEffectPath("ui_league", "Answer_bgtx");
-            SceneController.AddObjectToView(null, null, _ui.m_holderFlower, resPath, out _gameObject0, out _wrapper0);
-            string resPath1 = ResPathUtil.GetViewEffectPath("ui_Activity", "Everyday_2lizi");
-            SceneController.AddObjectToView(null, null, _ui.m_holderLizi, resPath1, out _gameObject1, out _wrapper1);
-            string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Everydayy_people");
-            SceneController.AddObjectToView(null, null, _ui.m_holderRole, resPath2, out _gameObject2, out _wrapper2);
-
-            string resPath4 = ResPathUtil.GetViewEffectPath("ui_fight_new", "Progress_head");
-            SceneController.AddObjectToView(null, null, _ui.m_proSign.m_holder, resPath4, out _gameObject4, out _wrapper4, 90);
-
+            _effectUI0 = EffectUIPool.CreateEffectUI(_ui.m_holderFlower, "ui_league", "Answer_bgtx");
+            _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holderLizi, "ui_Activity", "Everyday_2lizi");
+            _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holderRole, "ui_Activity", "Everydayy_people");
+            _effectUI4 = EffectUIPool.CreateEffectUI(_ui.m_proSign.m_holder, "ui_fight_new", "Progress_head");
         }
         protected override void AddEventListener()
         {
@@ -136,10 +130,9 @@ namespace GFGGame
                 bool canGet = _signCount >= signCfgs[i].day && !isGot;
                 if (canGet)
                 {
-                    if (_gameObject5 == null)
+                    if (_effectUI5 == null)
                     {
-                        string resPath5 = ResPathUtil.GetViewEffectPath("ui_Activity", "Everyday_enable");
-                        SceneController.AddObjectToView(null, null, _ui.m_proSign.m_holderReward, resPath5, out _gameObject5, out _wrapper5);
+                        _effectUI5 = EffectUIPool.CreateEffectUI(_ui.m_proSign.m_holderReward, "ui_Activity", "Everyday_enable");
                     }
                     _ui.m_proSign.m_holderReward.visible = canGet;
                     _ui.m_proSign.m_holderReward.position = new Vector2(item.target.x, 35);
@@ -181,10 +174,9 @@ namespace GFGGame
             DailySignBonusCfg bonusCfg = DailySignBonusCfgArray.Instance.GetCfgsBymonth(_month)[_index];
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(bonusCfg.bonusArr[0][0]);
             bool isGot = MathUtil.isBitSet(GameGlobal.myNumericComponent.GetAsLong(NumericType.SignDay), bonusCfg.day);
-            if (bonusCfg.day == _day && !isGot && _gameObject3 == null)
+            if (bonusCfg.day == _day && !isGot && _effectUI3 == null)
             {
-                string resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "everyday_kuang");
-                SceneController.AddObjectToView(null, null, item.m_holderSign, resPath3, out _gameObject3, out _wrapper3);
+                _effectUI3 = EffectUIPool.CreateEffectUI(item.m_holderSign, "ui_Activity", "everyday_kuang");
                 m_holderSign = item.m_holderSign;
             }
             item.m_holderSign.visible = false;

+ 29 - 70
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/RushSaleGiftBoxView.cs

@@ -21,25 +21,14 @@ namespace GFGGame
         private int _pageIndex; //当前页码,需要显示的数据的索引
 
         private List<GGraph> _graphList = new List<GGraph>();
-        private List<GameObject> _gameObjectList = new List<GameObject>();
-        private List<GoWrapper> _wrapperList = new List<GoWrapper>();
+        private List<EffectUI> _effectUIList = new List<EffectUI>();
         private List<Transition> _transitionList = new List<Transition>();
 
-        private GameObject _gameObject1;
-
-        private GameObject _gameObject2;
-
-        // private GameObject _gameObject3;
-        private GameObject _gameObject4;
-        private GameObject _gameObject5;
-
-        private GoWrapper _wrapper1;
-
-        private GoWrapper _wrapper2;
-
-        // private GoWrapper _wrapper3;
-        private GoWrapper _wrapper4;
-        private GoWrapper _wrapper5;
+        private EffectUI _effectUI1;
+        private EffectUI _effectUI2;
+        //private EffectUI _effectUI3;
+        private EffectUI _effectUI4;
+        private EffectUI _effectUI5;
 
         protected override void OnInit()
         {
@@ -88,32 +77,20 @@ namespace GFGGame
 
         private void AddEffect()
         {
-            string resPath1 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_pepole");
-            SceneController.AddObjectToView(null, null, _ui.m_holderPaoBaby, resPath1,
-                out _gameObject1, out _wrapper1);
-
-            // string resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_discount_chixu");
-            // SceneController.AddObjectToView(null, null, _ui.m_holderZheKouChiXu, resPath3,
-            //     out _gameObject3, out _wrapper3);
+            _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holderPaoBaby, "ui_Activity", "Limite_pepole");
 
+            //_effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_holderZheKouChiXu, "ui_Activity", "Limite_discount_chixu");
             Timers.inst.Add(0.8f, 1, (obj) =>
                 {
                     //防止手速超快关了又开开了又关导致的特效重复加载,因为这里是通过Timers延时加载的
                     if (ViewManager.isViewOpen(nameof(RushSaleGiftBoxView)))
                     {
-                        string resPath4 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_discount_baofa");
-                        SceneController.AddObjectToView(null, null, _ui.m_holderZheKou, resPath4,
-                            out _gameObject4, out _wrapper4);
-
-                        string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_button");
-                        SceneController.AddObjectToView(null, null, _ui.m_holderBtnBy, resPath2,
-                            out _gameObject2, out _wrapper2);
+                        _effectUI4 = EffectUIPool.CreateEffectUI(_ui.m_holderZheKou, "ui_Activity", "Limite_discount_baofa");
+                        _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holderBtnBy, "ui_Activity", "Limite_button");
                     }
                 }
             );
-            string resPath5 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_star");
-            SceneController.AddObjectToView(null, null, _ui.m_holderStar, resPath5,
-                out _gameObject5, out _wrapper5);
+            _effectUI5 = EffectUIPool.CreateEffectUI(_ui.m_holderStar, "ui_Activity", "Limite_star");
         }
 
         //实例化索引
@@ -302,12 +279,10 @@ namespace GFGGame
 
             if (!_graphList.Contains(uiItem.m_holderItem))
             {
-                string resPath = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_kuang");
-                SceneController.AddObjectToView(null, null, uiItem.m_holderItem, resPath, out var gameObject,
-                    out var wrapper);
+                EffectUI _effectUI = EffectUIPool.CreateEffectUI(uiItem.m_holderItem, "ui_Activity", "Limite_kuang");
+
                 _graphList.Add(uiItem.m_holderItem);
-                _gameObjectList.Add(gameObject);
-                _wrapperList.Add(wrapper);
+                _effectUIList.Add(_effectUI);
             }
 
             uiItem.m_t1.Play();
@@ -365,46 +340,30 @@ namespace GFGGame
 
         private void DestroyObjectFromView()
         {
-            foreach (var itemGameObject in _gameObjectList)
-            {
-                if (itemGameObject != null)
-                {
-                    GameObject.DestroyImmediate(itemGameObject);
-                }
-            }
-
-            _gameObjectList.Clear();
-
-            foreach (var itemWrapper in _wrapperList)
-            {
-                if (itemWrapper != null)
+            for (int i = 0; i < _effectUIList.Count; i++) {
+                if (_effectUIList[i] != null)
                 {
-                    itemWrapper.Dispose();
+                    EffectUIPool.Recycle(_effectUIList[i]);
+                    _effectUIList[i] = null;
                 }
             }
+            _effectUIList.Clear();
 
-            // foreach (var transition in _transitionList)
-            // {
-            //     if (transition != null)
-            //     {
-            //         transition.Stop(true, false);
-            //         transition.Dispose();
-            //         transition.PlayReverse();
-            //     }
-            // }
-            //  _transitionList.Clear();
-
-            _wrapperList.Clear();
             _graphList.Clear();
         }
 
         protected override void OnHide()
         {
-            SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
-            SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
-            // SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
-            SceneController.DestroyObjectFromView(_gameObject4, _wrapper4);
-            SceneController.DestroyObjectFromView(_gameObject5, _wrapper5);
+            EffectUIPool.Recycle(_effectUI1);
+            _effectUI1 = null;
+            EffectUIPool.Recycle(_effectUI2);
+            _effectUI2 = null;
+            //EffectUIPool.Recycle(_effectUI3);
+            //_effectUI3 = null;
+            EffectUIPool.Recycle(_effectUI4);
+            _effectUI4 = null;
+            EffectUIPool.Recycle(_effectUI5);
+            _effectUI5 = null;
             DestroyObjectFromView();
             this.RemoveEventListener();
             //Dispose();

+ 27 - 57
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/SpecialOfferGiftBoxView.cs

@@ -16,16 +16,11 @@ namespace GFGGame
 
         private int _pageIndex; //当前页码,需要显示的数据的索引
         private List<GGraph> _graphList = new List<GGraph>();
-        private List<GameObject> _gameObjectList = new List<GameObject>();
-        private List<GoWrapper> _wrapperList = new List<GoWrapper>();
+        private List<EffectUI> _effectUIList = new List<EffectUI>();
 
-        private GameObject _gameObject1;
-        private GameObject _gameObject2;
-        private GameObject _gameObject3;
-
-        private GoWrapper _wrapper1;
-        private GoWrapper _wrapper2;
-        private GoWrapper _wrapper3;
+        private EffectUI _effectUI1;
+        private EffectUI _effectUI2;
+        private EffectUI _effectUI3;
 
         protected override void OnInit()
         {
@@ -46,9 +41,13 @@ namespace GFGGame
         public override void Dispose()
         {
             base.Dispose();
-            SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
-            SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
-            SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
+            EffectUIPool.Recycle(_effectUI1);
+            _effectUI1 = null;
+            EffectUIPool.Recycle(_effectUI2);
+            _effectUI2 = null;
+            EffectUIPool.Recycle(_effectUI3);
+            _effectUI3 = null;
+      
             DestroyObjectFromView();
             if (_ui != null)
             {
@@ -85,25 +84,18 @@ namespace GFGGame
 
         private void AddEffect()
         {
-            string resPath1 = ResPathUtil.GetViewEffectPath("ui_Activity", "Prefer_person");
-            if (_gameObject1 == null)
+            if (_effectUI1 == null)
             {
-                SceneController.AddObjectToView(null, null, _ui.m_holderBaby, resPath1,
-                    out _gameObject1, out _wrapper1);
+                _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holderBaby, "ui_Activity", "Prefer_person");
             }
-
-            if (_gameObject2 == null)
+            if (_effectUI2 == null)
             {
-                string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Prefer_chixu_tx");
-                SceneController.AddObjectToView(null, null, _ui.m_holderChiXuTx, resPath2,
-                    out _gameObject2, out _wrapper2);
+                _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holderChiXuTx, "ui_Activity", "Prefer_chixu_tx");
             }
 
-            if (_gameObject3 == null)
+            if (_effectUI3 == null)
             {
-                string resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "Prefer_one_tx");
-                SceneController.AddObjectToView(null, null, _ui.m_holderOneTx, resPath3,
-                    out _gameObject3, out _wrapper3);
+                _effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_holderOneTx, "ui_Activity", "Prefer_one_tx");
             }
         }
 
@@ -269,22 +261,16 @@ namespace GFGGame
 
             if (!_graphList.Contains(uiItem.m_holderZheKou))
             {
-                string resPath = ResPathUtil.GetViewEffectPath("ui_Activity", "Prefer_but_zhekou");
-                SceneController.AddObjectToView(null, null, uiItem.m_holderZheKou, resPath, out var gameObject,
-                    out var wrapper);
+                EffectUI _effectUI = EffectUIPool.CreateEffectUI(uiItem.m_holderZheKou, "ui_Activity", "Prefer_but_zhekou");
                 _graphList.Add(uiItem.m_holderZheKou);
-                _gameObjectList.Add(gameObject);
-                _wrapperList.Add(wrapper);
+                _effectUIList.Add(_effectUI);
             }
 
             if (!_graphList.Contains(uiItem.m_holderBtn))
             {
-                string resPath = ResPathUtil.GetViewEffectPath("ui_Activity", "Prefer_button_buy");
-                SceneController.AddObjectToView(null, null, uiItem.m_holderBtn, resPath, out var gameObject,
-                    out var wrapper);
+                EffectUI _effectUI = EffectUIPool.CreateEffectUI(uiItem.m_holderBtn, "ui_Activity", "Prefer_button_buy");
                 _graphList.Add(uiItem.m_holderBtn);
-                _gameObjectList.Add(gameObject);
-                _wrapperList.Add(wrapper);
+                _effectUIList.Add(_effectUI);
             }
 
             uiItem.m_t0.Play();
@@ -329,12 +315,9 @@ namespace GFGGame
 
             if (!_graphList.Contains(uiItemChild.m_holderItem))
             {
-                string resPath = ResPathUtil.GetViewEffectPath("ui_Activity", "Prefer_kuang");
-                SceneController.AddObjectToView(null, null, uiItemChild.m_holderItem, resPath, out var gameObject,
-                    out var wrapper);
+                EffectUI _effectUI = EffectUIPool.CreateEffectUI(uiItemChild.m_holderItem, "ui_Activity", "Prefer_kuang");
                 _graphList.Add(uiItemChild.m_holderItem);
-                _gameObjectList.Add(gameObject);
-                _wrapperList.Add(wrapper);
+                _effectUIList.Add(_effectUI);
             }
 
             uiItemChild.m_t0.Play();
@@ -402,25 +385,12 @@ namespace GFGGame
 
         private void DestroyObjectFromView()
         {
-            foreach (var itemGameObject in _gameObjectList)
-            {
-                if (itemGameObject != null)
-                {
-                    GameObject.DestroyImmediate(itemGameObject);
-                }
-            }
-
-            _gameObjectList.Clear();
-
-            foreach (var itemWrapper in _wrapperList)
-            {
-                if (itemWrapper != null)
-                {
-                    itemWrapper.Dispose();
-                }
+            for (int i = 0; i < _effectUIList.Count; i++) {
+                EffectUIPool.Recycle(_effectUIList[i]);
+                _effectUIList[i] = null;
             }
+            _effectUIList.Clear();
 
-            _wrapperList.Clear();
             _graphList.Clear();
         }
 

+ 20 - 22
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxBonusShowView.cs

@@ -13,14 +13,12 @@ namespace GFGGame
         // private List<GameObject> _gameobjects = new List<GameObject>();
         private Dictionary<int, Dictionary<int, GameObject>> _gameobjects = new Dictionary<int, Dictionary<int, GameObject>>();
         private Dictionary<int, Dictionary<int, GoWrapper>> _wrappers = new Dictionary<int, Dictionary<int, GoWrapper>>();
-        private GameObject _gameobject;
-        private GoWrapper _wrapper;
-        private GameObject _gameObject0;
-        private GameObject _gameObject1;
-        private GameObject _gameObject2;
-        private GoWrapper _wrapper0;
-        private GoWrapper _wrapper1;
-        private GoWrapper _wrapper2;
+
+        private EffectUI _effectUI1;
+        private EffectUI _effectUI2;
+        private EffectUI _effectUI3;
+        private EffectUI _effectUI4;
+
         private int _effectIndex = 0;
         public override void Dispose()
         {
@@ -37,10 +35,14 @@ namespace GFGGame
                     SceneController.DestroyObjectFromView(_gameobjects[key][key1], _wrappers[key][key1]);
                 }
             }
-            SceneController.DestroyObjectFromView(_gameobject, _wrapper);
-            SceneController.DestroyObjectFromView(_gameObject0, _wrapper0);
-            SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
-            SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
+            EffectUIPool.Recycle(_effectUI1);
+            _effectUI1 = null;
+            EffectUIPool.Recycle(_effectUI2);
+            _effectUI2 = null;
+            EffectUIPool.Recycle(_effectUI3);
+            _effectUI3 = null;
+            EffectUIPool.Recycle(_effectUI4);
+            _effectUI4 = null;
 
             if (_ui != null)
             {
@@ -64,13 +66,9 @@ namespace GFGGame
         }
         private void UpdateEffect()
         {
-
-            string resPath0 = ResPathUtil.GetViewEffectPath("ui_LuckyBox", "bg_liuxing");
-            SceneController.AddObjectToView(null, null, _ui.m_holder_star, resPath0, out _gameObject0, out _wrapper0);
-            string resPath1 = ResPathUtil.GetViewEffectPath("ui_LuckyBox", "CK_UI");
-            SceneController.AddObjectToView(null, null, _ui.m_holder_bg, resPath1, out _gameObject1, out _wrapper1);
-            string resPath2 = ResPathUtil.GetViewEffectPath("ui_LuckyBox", "bg_cloud");
-            SceneController.AddObjectToView(null, null, _ui.m_holder_cloud, resPath2, out _gameObject2, out _wrapper2);
+            _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holder_star, "ui_LuckyBox", "bg_liuxing");
+            _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holder_bg, "ui_LuckyBox", "CK_UI");
+            _effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_holder_cloud, "ui_LuckyBox", "bg_cloud");
         }
         protected override void OnShown()
         {
@@ -110,7 +108,7 @@ namespace GFGGame
             item.m_comIcon.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
             RarityIconController.UpdateRarityIcon(item.m_comIcon.m_rarity, itemData.id, false);
 
-            string resPath = ResPathUtil.GetViewEffectPath("ui_LuckyBox", itemCfg.rarity == ConstDressRarity.Rarity_TIANYI ? "CK_all_01" : "CK_all_02");
+            string resPath = itemCfg.rarity == ConstDressRarity.Rarity_TIANYI ? "CK_all_01" : "CK_all_02";
 
             if (countType == 10 && itemCfg.rarity > 2 && (!_gameobjects.ContainsKey(itemCfg.rarity) || !_gameobjects[itemCfg.rarity].ContainsKey(index)))
             {
@@ -125,10 +123,10 @@ namespace GFGGame
                 _wrappers[itemCfg.rarity][index] = wrapper;
 
             }
-            if (countType == 1 && itemCfg.rarity > 2 && _gameobject == null)
+            if (countType == 1 && itemCfg.rarity > 2 && _effectUI4 == null)
             {
                 GGraph holder = itemCfg.rarity == 3 ? item.m_comIcon.m_holder : item.m_comIcon.m_holder1;
-                SceneController.AddObjectToView(_gameobject, _wrapper, holder, resPath, out _gameobject, out _wrapper);
+                _effectUI4 = EffectUIPool.CreateEffectUI(holder, "ui_LuckyBox", resPath);
             }
             int count = 0;
             bool isFirst = false;

+ 12 - 15
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxStarView.cs

@@ -25,12 +25,9 @@ namespace GFGGame
         private Dictionary<int, List<GoWrapper>> dicWraper = new Dictionary<int, List<GoWrapper>>();
         private List<GameObject> lineObj = new List<GameObject>();
         private List<GoWrapper> lineWrapper = new List<GoWrapper>();
-        private GameObject _gameObject0;
-        private GameObject _gameObject1;
-        private GameObject _gameObject2;
-        private GoWrapper _wrapper0;
-        private GoWrapper _wrapper1;
-        private GoWrapper _wrapper2;
+        private EffectUI _effectUI1;
+        private EffectUI _effectUI2;
+        private EffectUI _effectUI3;
         private GObject curComStar;//当前选中的星星
         private Vector2 lastPos;//鼠标的上一个位置,每颗星星初始时默认为Vector2.right;
 
@@ -43,9 +40,12 @@ namespace GFGGame
         private bool showGuide = false;
         public override void Dispose()
         {
-            SceneController.DestroyObjectFromView(_gameObject0, _wrapper0);
-            SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
-            SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
+            EffectUIPool.Recycle(_effectUI1);
+            _effectUI1 = null;
+            EffectUIPool.Recycle(_effectUI2);
+            _effectUI2 = null;
+            EffectUIPool.Recycle(_effectUI3);
+            _effectUI3 = null;
             if (_ui != null)
             {
                 _ui.Dispose();
@@ -105,12 +105,9 @@ namespace GFGGame
         }
         private void UpdateEffect()
         {
-            string resPath = ResPathUtil.GetViewEffectPath("ui_LuckyBox", "bg_liuxing");
-            SceneController.AddObjectToView(null, null, _ui.m_holder_star, resPath, out _gameObject0, out _wrapper0);
-            string resPath1 = ResPathUtil.GetViewEffectPath("ui_LuckyBox", "bg_thing");
-            SceneController.AddObjectToView(null, null, _ui.m_holder_bg, resPath1, out _gameObject1, out _wrapper1);
-            string resPath2 = ResPathUtil.GetViewEffectPath("ui_LuckyBox", "bg_cloud");
-            SceneController.AddObjectToView(null, null, _ui.m_holder_cloud, resPath2, out _gameObject2, out _wrapper2);
+            _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holder_star, "ui_LuckyBox", "bg_liuxing");
+            _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holder_bg, "ui_LuckyBox", "bg_thing");
+            _effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_holder_cloud, "ui_LuckyBox", "bg_cloud");
         }
         protected override void OnShown()
         {

+ 8 - 10
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

@@ -14,10 +14,8 @@ namespace GFGGame
         private ValueBarController _valueBarController;
         private Dictionary<int, LuckyBoxController> _lcukyBoxCtrl = new Dictionary<int, LuckyBoxController>();
 
-        private GameObject _gameObject0;
-        private GameObject _gameObject1;
-        private GoWrapper _wrapper0;
-        private GoWrapper _wrapper1;
+        private EffectUI _effectUI1;
+        private EffectUI _effectUI2;
         private DressUpObjUI _dressUpObjUIXiHe;
 
         private DressUpObjUI _dressUpObjUIChangXi;
@@ -48,8 +46,10 @@ namespace GFGGame
                 _dressUpObjUIChangXi.Dispose();
                 _dressUpObjUIChangXi = null;
             }
-            SceneController.DestroyObjectFromView(_gameObject0, _wrapper0);
-            SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
+            EffectUIPool.Recycle(_effectUI1);
+            _effectUI1 = null;
+            EffectUIPool.Recycle(_effectUI2);
+            _effectUI2 = null;
 
             if (_ui != null)
             {
@@ -196,10 +196,8 @@ namespace GFGGame
             holder.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
             comBox.m_holder.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
 
-            string resPath0 = ResPathUtil.GetViewEffectPath("ui_LuckyBox", "Button_Glow");
-            SceneController.AddObjectToView(_gameObject0, _wrapper0, holder, resPath0, out _gameObject0, out _wrapper0);
-            string resPath1 = ResPathUtil.GetViewEffectPath("ui_LuckyBox", "but_text_dc");
-            SceneController.AddObjectToView(_gameObject1, _wrapper1, comBox.m_holder, resPath1, out _gameObject1, out _wrapper1);
+            _effectUI1 = EffectUIPool.CreateEffectUI(holder, "ui_LuckyBox", "Button_Glow");
+            _effectUI2 = EffectUIPool.CreateEffectUI(comBox.m_holder, "ui_LuckyBox", "but_text_dc");
 
             comBox.m_comCostOne.m_txtCost.text = cfg.costNum.ToString();
             comBox.m_comCostOne.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(cfg.costID).res);

+ 9 - 13
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryCardChoose.cs

@@ -17,15 +17,15 @@ namespace GFGGame
         private int _cardId = 0; //记录打开界面时的竞技场卡牌id
         private int _skillId = 0;
 
-        private List<GameObject> _effects = new List<GameObject>();
-        private List<GoWrapper> _wrappers = new List<GoWrapper>();
-        private GameObject gameObject0;
-        private GoWrapper wrapper0;
+        private List<EffectUI> _effects = new List<EffectUI>();
+        private EffectUI _effectUI1;
         private GComponent _comSelected;
 
         public override void Dispose()
         {
             base.Dispose();
+            //EffectUIPool.Recycle(_effectUI1);
+            //_effectUI1 = null;
             if (_comSelected != null)
             {
                 _comSelected.RemoveFromParent();
@@ -34,7 +34,8 @@ namespace GFGGame
 
             for (int i = 0; i < _effects.Count; i++)
             {
-                SceneController.DestroyObjectFromView(_effects[i], _wrappers[i]);
+                EffectUIPool.Recycle(_effects[i]);
+                _effects[i] = null;
             }
 
             if (_ui != null)
@@ -65,9 +66,8 @@ namespace GFGGame
             _ui.m_btnUpCard.onClick.Add(OnBtnUpCardClikc);
 
             _comSelected = UIPackage.CreateObject(UI_MainUI.PACKAGE_NAME, "ComCardSelect").asCom;
-            // string resPath = ResPathUtil.GetViewEffectPath("ui_fight_new", "kp_Select");
+            //_effectUI1 = EffectUIPool.CreateEffectUI(_comSelected.GetChild("holder").asGraph, "ui_fight_new", "kp_Select");
 
-            // SceneController.AddObjectToView(gameObject0, null, _comSelected.GetChild("holder").asGraph, resPath, out gameObject0, out wrapper0);
         }
 
         protected override void OnShown()
@@ -186,12 +186,8 @@ namespace GFGGame
             // comStar.m_c1.selectedIndex = cardData.star;
             if (_effects.Count <= index)
             {
-                string resPath = ResPathUtil.GetViewEffectPath("ui_fight_new", "kp_Select");
-                GameObject gameObject0;
-                GoWrapper wrapper0;
-                // SceneController.AddObjectToView(null, null, item.m_comEff.m_holder, resPath, out gameObject0, out wrapper0);
-                // _effects.Add(gameObject0);
-                // _wrappers.Add(wrapper0);
+                //EffectUI _effectUI = EffectUIPool.CreateEffectUI(item.m_comEff.m_holder, "ui_fight_new", "kp_Select");
+                // _effects.Add(_effectUI);
             }
 
             UI_ListCardItem.ProxyEnd();

+ 4 - 8
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterView.cs

@@ -15,10 +15,7 @@ namespace GFGGame
         private ValueBarController _valueBarController;
         private GObject _unPasslevelItem;
         private GObject _endLevelItem;
-
-        private GameObject _gameObject;
-        private GoWrapper _wrapper;
-
+        private EffectUI _effectUI1;
         private GComponent _comEff;
         public override void Dispose()
         {
@@ -32,7 +29,8 @@ namespace GFGGame
                 _valueBarController.Dispose();
                 _valueBarController = null;
             }
-            SceneController.DestroyObjectFromView(_gameObject, _wrapper);
+            EffectUIPool.Recycle(_effectUI1);
+            _effectUI1 = null;
             if (_ui != null)
             {
                 _ui.Dispose();
@@ -73,9 +71,7 @@ namespace GFGGame
 
             _comEff = new GComponent();
             _comEff = UIPackage.CreateObject(UI_MainUI.PACKAGE_NAME, "ComEff").asCom;
-            string resPath = ResPathUtil.GetViewEffectPath("ui_gk", "ui_gk_sg");
-            SceneController.AddObjectToView(_gameObject, _wrapper, _comEff.GetChild("holder").asGraph, resPath, out _gameObject, out _wrapper);
-
+            _effectUI1 = EffectUIPool.CreateEffectUI(_comEff.GetChild("holder").asGraph, "ui_gk", "ui_gk_sg");
         }
         protected override void AddEventListener()
         {

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

@@ -15,9 +15,8 @@ namespace GFGGame
         private UI_CompArrow _arrow;
         private GameObject _sceneObject;
         private GameObject _scenePrefab;
-        private GameObject _npcHead;
+        private EffectUI _effectUI1;
         private DressUpObjUI _dressUpObjUI;
-        private GoWrapper _npcWrapper;
         private GTextField _wordTextField;
         //žçÇéÍęłÉťŘľ÷
         private OnCompleteStoryDialogCall _onCompleteStoryDialogCall;
@@ -57,7 +56,8 @@ namespace GFGGame
             _wordTextField = null;
             _arrow = null;
             _isShowLetters = false;
-            SceneController.DestroyObjectFromView(_npcHead, _npcWrapper);
+            EffectUIPool.Recycle(_effectUI1);
+            _effectUI1 = null;
             _onScreenEffectComplete = null;
             Timers.inst.Remove(UpdateLetters);
             if (_ui != null)
@@ -403,8 +403,7 @@ namespace GFGGame
                     //śŔÁ˘śŻť­
                     _ui.m_dialogHead.m_compDressUp.target.visible = false;
                     _ui.m_dialogHead.m_comphead.target.visible = true;
-                    string resPath = ResPathUtil.GetViewEffectPath("ui_nzbq", headAniCfg.headAni);
-                    SceneController.AddObjectToView(null, _npcWrapper, _ui.m_dialogHead.m_comphead.m_holder, resPath, out _npcHead, out _npcWrapper);
+                    _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_dialogHead.m_comphead.m_holder, "ui_nzbq", headAniCfg.headAni);
                 }
                 else
                 {

+ 9 - 10
GameClient/Assets/Game/HotUpdate/Views/MainStory/StorySkillView.cs

@@ -11,15 +11,15 @@ namespace GFGGame
     {
         private UI_StorySkillUI _ui;
         private Dictionary<int, int> skillScoreDic;
-        private GameObject _gameObject0;
-        private GameObject _gameObject1;
-        private GoWrapper _wrapper0;
-        private GoWrapper _wrapper1;
+        private EffectUI _effectUI1;
+        private EffectUI _effectUI2;
 
         public override void Dispose()
         {
-            SceneController.DestroyObjectFromView(_gameObject0, _wrapper0);
-            SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
+            EffectUIPool.Recycle(_effectUI1);
+            _effectUI1 = null;
+            EffectUIPool.Recycle(_effectUI2);
+            _effectUI2 = null;
             if (_ui != null)
             {
                 _ui.Dispose();
@@ -34,10 +34,9 @@ namespace GFGGame
             viewCom = _ui.target;
             isfullScreen = true;
             // this.modal = false;
-            string resPath = ResPathUtil.GetViewEffectPath("ui_fight_new", "CFKP_TX_down");
-            SceneController.AddObjectToView(null, null, _ui.m_comSkillShow.m_holderBottom, resPath, out _gameObject0, out _wrapper0);
-            string resPath1 = ResPathUtil.GetViewEffectPath("ui_fight_new", "CFKP_TX_up");
-            SceneController.AddObjectToView(null, null, _ui.m_comSkillShow.m_holderTop, resPath1, out _gameObject1, out _wrapper1);
+            _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_comSkillShow.m_holderBottom, "ui_fight_new", "CFKP_TX_down");
+            _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_comSkillShow.m_holderTop, "ui_fight_new", "CFKP_TX_up");
+
             _ui.m_comSkillShow.m_t0.ignoreEngineTimeScale = false;
             _ui.m_comSkillShow.m_t1.ignoreEngineTimeScale = false;
             _ui.m_t1.ignoreEngineTimeScale = false;

+ 49 - 56
GameClient/Assets/Game/HotUpdate/Views/MainStory/StroyFightResultView.cs

@@ -14,42 +14,47 @@ namespace GFGGame
 
         private GameObject _scenePrefab;
         private GameObject _sceneObject;
-        private GameObject _gameObject0;
-        private GameObject _gameObject1;
-        private GameObject _gameObject2;
-        private GameObject _gameObject3;
-        private GameObject _gameObject4;
-        private GameObject _gameObject5;
-        private GameObject _gameObject6;
-        private GameObject _gameObject7;
-        private GameObject _gameObject8;
-        private GameObject _gameObject9;
-        private GameObject _gameObject10;
-        private GameObject _gameObject11;
-        private GoWrapper _wrapper0;
-        private GoWrapper _wrapper1;
-        private GoWrapper _wrapper2;
-        private GoWrapper _wrapper3;
-        private GoWrapper _wrapper4;
-        private GoWrapper _wrapper5;
-        private GoWrapper _wrapper6;
-        private GoWrapper _wrapper7;
-        private GoWrapper _wrapper8;
-        private GoWrapper _wrapper9;
-        private GoWrapper _wrapper10;
-        private GoWrapper _wrapper11;
+        private EffectUI _effectUI0;
+        private EffectUI _effectUI1;
+        private EffectUI _effectUI2;
+        private EffectUI _effectUI3;
+        private EffectUI _effectUI4;
+        private EffectUI _effectUI5;
+        private EffectUI _effectUI6;
+        private EffectUI _effectUI7;
+        private EffectUI _effectUI8;
+        private EffectUI _effectUI9;
+        private EffectUI _effectUI10;
+        private EffectUI _effectUI11;
+
         private StoryFightResultData _resultData;
 
         public override void Dispose()
         {
-            SceneController.DestroyObjectFromView(_gameObject0, _wrapper0);
-            SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
-            SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
-            SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
-            SceneController.DestroyObjectFromView(_gameObject4, _wrapper4);
-            SceneController.DestroyObjectFromView(_gameObject5, _wrapper5);
-            SceneController.DestroyObjectFromView(_gameObject6, _wrapper6);
-            SceneController.DestroyObjectFromView(_gameObject7, _wrapper7);
+            EffectUIPool.Recycle(_effectUI0);
+            _effectUI0 = null;
+            EffectUIPool.Recycle(_effectUI1);
+            _effectUI1 = null;
+            EffectUIPool.Recycle(_effectUI2);
+            _effectUI2 = null;
+            EffectUIPool.Recycle(_effectUI3);
+            _effectUI3 = null;
+            EffectUIPool.Recycle(_effectUI4);
+            _effectUI4 = null;
+            EffectUIPool.Recycle(_effectUI5);
+            _effectUI5 = null;
+            EffectUIPool.Recycle(_effectUI6);
+            _effectUI6 = null;
+            EffectUIPool.Recycle(_effectUI7);
+            _effectUI7 = null;
+            EffectUIPool.Recycle(_effectUI8);
+            _effectUI8 = null;
+            EffectUIPool.Recycle(_effectUI9);
+            _effectUI9 = null;
+            EffectUIPool.Recycle(_effectUI10);
+            _effectUI10 = null;
+            EffectUIPool.Recycle(_effectUI11);
+            _effectUI11 = null;
             if (_ui != null)
             {
                 _ui.Dispose();
@@ -81,30 +86,18 @@ namespace GFGGame
         }
         private void AddEffect()
         {
-            string resPath0 = ResPathUtil.GetViewEffectPath("ui_fight_new", "ZDJS_lose");
-            SceneController.AddObjectToView(null, null, _ui.m_comResult.m_holderResult0, resPath0, out _gameObject0, out _wrapper0);
-            string resPath1 = ResPathUtil.GetViewEffectPath("ui_fight_new", "ZDJS_qualified");
-            SceneController.AddObjectToView(null, null, _ui.m_comResult.m_holderResult1, resPath1, out _gameObject1, out _wrapper1);
-            string resPath2 = ResPathUtil.GetViewEffectPath("ui_fight_new", "ZDJS_good");
-            SceneController.AddObjectToView(null, null, _ui.m_comResult.m_holderResult2, resPath2, out _gameObject2, out _wrapper2);
-            string resPath3 = ResPathUtil.GetViewEffectPath("ui_fight_new", "ZDJS_Perfect");
-            SceneController.AddObjectToView(null, null, _ui.m_comResult.m_holderResult3, resPath3, out _gameObject3, out _wrapper3);
-            string resPath4 = ResPathUtil.GetViewEffectPath("ui_fight_new", "ZDJS_Text_kuang");
-            SceneController.AddObjectToView(null, null, _ui.m_comResult.m_holderScore, resPath4, out _gameObject4, out _wrapper4);
-            string resPath5 = ResPathUtil.GetViewEffectPath("ui_fight_new", "ZDJS_STAR");
-            SceneController.AddObjectToView(null, null, _ui.m_comResult.m_holderStar3, resPath5, out _gameObject7, out _wrapper7);
-            SceneController.AddObjectToView(null, null, _ui.m_comResult.m_holderStar2, resPath5, out _gameObject6, out _wrapper6);
-            SceneController.AddObjectToView(null, null, _ui.m_comResult.m_holderStar1, resPath5, out _gameObject5, out _wrapper5);
-
-            string resPath8 = ResPathUtil.GetViewEffectPath("ui_fight_new", "ZDJS_jindu_di");
-            SceneController.AddObjectToView(null, null, _ui.m_comExpBar.m_holderProHead, resPath8, out _gameObject8, out _wrapper8);
-            string resPath9 = ResPathUtil.GetViewEffectPath("ui_fight_new", "ZDJS_jindu_head");
-            SceneController.AddObjectToView(null, null, _ui.m_comExpBar.m_proExp.m_holder, resPath9, out _gameObject9, out _wrapper9);
-            string resPath10 = ResPathUtil.GetViewEffectPath("ui_fight_new", "ZDJS_jindu_tx");
-            SceneController.AddObjectToView(null, null, _ui.m_comExpBar.m_proExp.m_comHolder.m_holder, resPath10, out _gameObject10, out _wrapper10);
-            string resPath11 = ResPathUtil.GetViewEffectPath("ui_fight_new", "ZDJS_player");
-            SceneController.AddObjectToView(null, null, _ui.m_comExpBar.m_holderHead, resPath11, out _gameObject11, out _wrapper11);
-
+            _effectUI0 = EffectUIPool.CreateEffectUI(_ui.m_comResult.m_holderResult0, "ui_fight_new", "ZDJS_lose");
+            _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_comResult.m_holderResult1, "ui_fight_new", "ZDJS_qualified");
+            _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_comResult.m_holderResult2, "ui_fight_new", "ZDJS_good");
+            _effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_comResult.m_holderResult3, "ui_fight_new", "ZDJS_Perfect");
+            _effectUI4 = EffectUIPool.CreateEffectUI(_ui.m_comResult.m_holderScore, "ui_fight_new", "ZDJS_Text_kuang");
+            _effectUI5 = EffectUIPool.CreateEffectUI(_ui.m_comResult.m_holderStar3, "ui_fight_new", "ZDJS_STAR");
+            _effectUI6 = EffectUIPool.CreateEffectUI(_ui.m_comResult.m_holderStar2, "ui_fight_new", "ZDJS_STAR");
+            _effectUI7 = EffectUIPool.CreateEffectUI(_ui.m_comResult.m_holderStar1, "ui_fight_new", "ZDJS_STAR");
+            _effectUI8 = EffectUIPool.CreateEffectUI(_ui.m_comExpBar.m_holderProHead, "ui_fight_new", "ZDJS_jindu_di");
+            _effectUI9 = EffectUIPool.CreateEffectUI(_ui.m_comExpBar.m_proExp.m_holder, "ui_fight_new", "ZDJS_jindu_head");
+            _effectUI10 = EffectUIPool.CreateEffectUI(_ui.m_comExpBar.m_proExp.m_comHolder.m_holder, "ui_fight_new", "ZDJS_jindu_tx");
+            _effectUI11 = EffectUIPool.CreateEffectUI(_ui.m_comExpBar.m_holderHead, "ui_fight_new", "ZDJS_player");
         }
         protected override void OnShown()
         {

+ 3 - 7
GameClient/Assets/Game/HotUpdate/Views/ViewGlobal.cs

@@ -7,8 +7,7 @@ namespace GFGGame
     public class ViewGlobal
     {
         private static UI_ComHolder comHolder;
-        private static GameObject _gameObj;
-        private static GoWrapper _wrapper;
+        private static EffectUI _effectUI1;
 
         public static void CreatClickEffect()
         {
@@ -18,13 +17,11 @@ namespace GFGGame
                 comHolder.target.touchable = false;
                 ViewManager.AddChildToFloatLayer(comHolder.target);
                 comHolder.target.SetPosition(-100, -100, 0);
-
-                string resPath = ResPathUtil.GetViewEffectPath("ui_dj", "DJ");
-                SceneController.AddObjectToView(_gameObj, _wrapper, comHolder.m_holder, resPath, out _gameObj, out _wrapper);
-
+                _effectUI1 = EffectUIPool.CreateEffectUI(comHolder.m_holder, "ui_dj", "DJ");
                 GRoot.inst.onTouchBegin.Add(SetClickPos);
             }
         }
+
         private static void SetClickPos()
         {
             Vector2 pos = GRoot.inst.GlobalToLocal(Stage.inst.touchPosition);
@@ -32,6 +29,5 @@ namespace GFGGame
             comHolder.m_holder.visible = true;
             comHolder.target.SetPosition(pos.x, pos.y, 0);
         }
-
     }
 }