From 6ea752f7f7a4ed47de871f896f6892f14faed044 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期二, 19 三月 2019 16:54:51 +0800
Subject: [PATCH] 3335 itemcell 制作成prefab

---
 System/Dogz/DogzEquip.cs                   |    1 
 System/Dogz/DogzItemCell.cs                |    1 
 System/Compose/New/ComposeWingsWin.cs      |   55 --------
 System/KnapSack/New/CommonItemBaisc.cs     |   69 ++++++++---
 System/Strengthening/WingsRefined.cs       |    4 
 System/KnapSack/New/BagItemCell.cs         |   52 ++++++++
 System/KnapSack/New/BagItemCell.cs.meta    |   12 ++
 System/KnapSack/New/BagWin.cs              |   29 +---
 System/KnapSack/New/GridCell.cs            |   11 -
 UI/Common/UIPrefabLoader.cs.meta           |   12 ++
 System/KnapSack/New/ButtonExtend.cs        |   43 +++---
 System/Strengthening/GodBeastChildNodes.cs |    1 
 System/KnapSack/New/ItemCell.cs            |    4 
 System/KnapSack/New/DepotWin.cs            |    8 
 UI/Common/UIPrefabLoader.cs                |   53 ++++++++
 System/Dogz/SelectCell.cs                  |    1 
 16 files changed, 227 insertions(+), 129 deletions(-)

diff --git a/System/Compose/New/ComposeWingsWin.cs b/System/Compose/New/ComposeWingsWin.cs
index 3f35273..75503ea 100644
--- a/System/Compose/New/ComposeWingsWin.cs
+++ b/System/Compose/New/ComposeWingsWin.cs
@@ -418,7 +418,7 @@
             {
                 case SelectItemType.unfixed:
                     matCell.SetDisplay(compoundModel, NeedMatType.unfixedItem, false, "", 0, itemIndex);
-                    IsComposeBind = ChangeFixedMatUI();
+                    IsComposeBind = false;
                     break;
                 case SelectItemType.addons:
                     matCell.SetDisplay(compoundModel, NeedMatType.addItem, false, "", 0, itemIndex);
@@ -438,7 +438,7 @@
                 case NeedMatType.unfixedItem:
                     matCell.SetDisplay(compoundModel, matType, false, 
                         UIHelper.ReplaceNewLine(Language.Get("ComposeWin_PutInText_1")));
-                    IsComposeBind = ChangeFixedMatUI();
+                    IsComposeBind = false;
                     break;
                 case NeedMatType.addItem:
                     matCell.SetDisplay(compoundModel, matType, false, 
@@ -474,57 +474,6 @@
             UpdateComposeMat();
 
             composeItemSelectObj.SetActive(compoundModel.secondType < 4);
-        }
-
-        private bool ChangeFixedMatUI()
-        {
-            if (compoundModel == null) return false;
-            var packType = composeWinModel.GetPackTypeByMakerId(compoundModel.makeID);
-            SinglePack singlePack = playerPack.GetSinglePack(packType);
-            if (singlePack == null) return false;
-
-            bool isBind = false;
-            Dictionary<int,ItemModel> unfixedMatDict = selectModel.GetHaveUnfixedSelectItem();
-            //foreach(var model in unfixedMatDict.Values)
-            //{
-            //    if(model.isBind == 1)
-            //    {
-            //        isBind = true;
-            //        break;
-            //    }
-            //}
-            int[] fixedIds = compoundModel.itemID;
-            int[] fixedCounts = compoundModel.itemCount;
-            int[] fixedDisplays = compoundModel.itemDisplay;
-            for (int i = 0; i < fixedDisplays.Length; i++)
-            {
-                var fixedDisplay = fixedDisplays[i];
-                if (fixedDisplay != 0)
-                {
-                    var matCell = fixedAndUnfixeds[fixedDisplay - 1];
-                    int fixedId = fixedIds[i];
-                    var bindIcon = matCell.itemCell.auctionIcon;
-                    bindIcon.gameObject.SetActive(false);
-                    //if (isBind)
-                    //{
-                    //    var list= singlePack.GetItemsById(fixedId);
-                    //    if (list != null)
-                    //    {
-                    //        for (int j = 0; j < list.Count; j++)
-                    //        {
-                    //            if (list[j].isBind == 1)
-                    //            {
-                    //                bindIcon.gameObject.SetActive(true);
-                    //                break;
-                    //            }
-                    //        }
-                    //    }
-                    //}
-                  
-                }
-            }
-
-            return isBind;
         }
 
         public int RefreshComposeSuccessRate(int initRate)
diff --git a/System/Dogz/DogzEquip.cs b/System/Dogz/DogzEquip.cs
index 6509c5f..e1e8ba2 100644
--- a/System/Dogz/DogzEquip.cs
+++ b/System/Dogz/DogzEquip.cs
@@ -15,7 +15,6 @@
         public void Display(ItemModel model)
         {
             itemBaisc.Init(model);
-            itemBaisc.auctionIcon.gameObject.SetActive(false);
             int strenLv = 0;
             if(model.GetUseData((int)ItemUseDataKey.dogzEquipPlus) != null)
             {
diff --git a/System/Dogz/DogzItemCell.cs b/System/Dogz/DogzItemCell.cs
index 72e14a8..0bcc1c7 100644
--- a/System/Dogz/DogzItemCell.cs
+++ b/System/Dogz/DogzItemCell.cs
@@ -50,7 +50,6 @@
                 itemBaisc.stateIcon.gameObject.SetActive(false);
             }
 
-            itemBaisc.auctionIcon.gameObject.SetActive(false);
             itemBaisc.button.RemoveAllListeners();
             itemBaisc.button.AddListener(()=>
             {
diff --git a/System/Dogz/SelectCell.cs b/System/Dogz/SelectCell.cs
index ce8bdbf..ae5c6f6 100644
--- a/System/Dogz/SelectCell.cs
+++ b/System/Dogz/SelectCell.cs
@@ -22,7 +22,6 @@
             nameTex.text = model.config.ItemName;
             nameTex.color = UIHelper.GetUIColor(model.config.ItemColor,true);
             itemBaisc.Init(model);
-            itemBaisc.auctionIcon.gameObject.SetActive(false);
             int strenLv = 0;
             if (model.GetUseData((int)ItemUseDataKey.dogzEquipPlus) != null)
             {
diff --git a/System/KnapSack/New/BagItemCell.cs b/System/KnapSack/New/BagItemCell.cs
new file mode 100644
index 0000000..607e9db
--- /dev/null
+++ b/System/KnapSack/New/BagItemCell.cs
@@ -0,0 +1,52 @@
+锘�//--------------------------------------------------------
+//    [Author]:           绗簩涓栫晫
+//    [  Date ]:           Tuesday, March 19, 2019
+//--------------------------------------------------------
+using UnityEngine;
+using System.Collections;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+
+    public class BagItemCell : CommonItemBaisc
+    {
+        Image m_AuctionIcon;
+        public Image auctionIcon {
+            get {
+                if (m_AuctionIcon == null)
+                {
+                    m_AuctionIcon = this.transform.GetComponent<Image>("Img_Auction");
+                }
+                return m_AuctionIcon;
+            }
+        }
+
+        /// <summary>
+        /// 鍒濆鍖栨暟鎹� bool鍊肩敤鏉ュ垽鏂槸鍚﹂渶瑕佸睍绀鸿瘎鍒嗛珮浣庢垨鑰呰亴涓氶檺鍒�
+        /// </summary>
+        /// <param name="model"></param>
+        /// <param name="isCompare"></param>
+        public override void Init(ItemModel model, bool isCompare = false)
+        {
+            base.Init(model, isCompare);
+            auctionIcon.gameObject.SetActive(model.isAuction);
+        }
+
+        /// <summary>
+        ///  鍒濆鍖栨暟鎹紙棰勮锛�
+        /// </summary>
+        /// <param name="model"></param>
+        public override void Init(ItemCellModel model)
+        {
+            base.Init(model);
+            auctionIcon.gameObject.SetActive(false);
+        }
+
+
+    }
+
+}
+
+
+
diff --git a/System/KnapSack/New/BagItemCell.cs.meta b/System/KnapSack/New/BagItemCell.cs.meta
new file mode 100644
index 0000000..d58553f
--- /dev/null
+++ b/System/KnapSack/New/BagItemCell.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 3271fd9e5f6ed824dabe85aa9aa004e5
+timeCreated: 1552982226
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/System/KnapSack/New/BagWin.cs b/System/KnapSack/New/BagWin.cs
index fa6b871..163681c 100644
--- a/System/KnapSack/New/BagWin.cs
+++ b/System/KnapSack/New/BagWin.cs
@@ -24,20 +24,9 @@
         #endregion
 
         private SinglePack packModel;
-        private ItemModel _clickItemModel;
-        private bool isDoubleClick = false;
 
-        ItemTipsModel _itemTipsModel;
-        ItemTipsModel itemTipsModel {
-            get {
-                return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>());
-            }
-        }
-
-        PackModel _playerPack;
-        PackModel playerPack {
-            get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); }
-        }
+        ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
+        PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
 
         private GridCell _lookEquipCell = null;
 
@@ -112,10 +101,10 @@
         {
             if (AchievementGoto.guideAchievementId != 0)
             {
-                SuccessConfig successConfig = SuccessConfig.Get(AchievementGoto.guideAchievementId);
+                var successConfig = SuccessConfig.Get(AchievementGoto.guideAchievementId);
                 if (successConfig != null)
                 {
-                    JumpUIType jump = (JumpUIType)successConfig.Jump;
+                    var jump = (JumpUIType)successConfig.Jump;
                     switch (successConfig.Type)
                     {
                         case 94:
@@ -257,11 +246,11 @@
                 {
                     gridCell.itemCell.gameObject.SetActive(true);
                     gridCell.itemCell.Init(itemModel, true);
-                    gridCell.itemCellBtn.OnOneParaClick = null;
-                    gridCell.itemCellBtn.m_OnDbClick = null;
+                    gridCell.itemCellBtn.onceClick = null;
+                    gridCell.itemCellBtn.doubleClick = null;
                     if (KnapSackWin.titleType == KnapsackFuncTitle.depot)
                     {
-                        gridCell.itemCellBtn.OnOneParaClick = (int info) =>
+                        gridCell.itemCellBtn.onceClick = (int info) =>
                         {
 
                             itemTipsModel.SetItemTipsModel(PackType.Item, itemModel.guid, false, true);
@@ -269,7 +258,7 @@
                             itemTipsModel.ShowUICtrl();
 
                         };
-                        gridCell.itemCellBtn.m_OnDbClick = () =>
+                        gridCell.itemCellBtn.doubleClick = () =>
                           {
                               ItemOperateUtility.Instance.PutInWareHouse(itemModel.guid);
                           };
@@ -277,7 +266,7 @@
                     }
                     else if (KnapSackWin.titleType == KnapsackFuncTitle.bag)
                     {
-                        gridCell.itemCellBtn.OnOneParaClick = (int info) =>
+                        gridCell.itemCellBtn.onceClick = (int info) =>
                         {
                             itemTipsModel.SetItemTipsModel(PackType.Item, itemModel.guid, false, true);
                             itemTipsModel.SetBagTipsBtn(itemTipsModel.curAttrData);
diff --git a/System/KnapSack/New/ButtonExtend.cs b/System/KnapSack/New/ButtonExtend.cs
index 0aedcca..2ce74df 100644
--- a/System/KnapSack/New/ButtonExtend.cs
+++ b/System/KnapSack/New/ButtonExtend.cs
@@ -1,62 +1,65 @@
 锘縰sing System;
-using System.Collections;
-using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.EventSystems;
-using UnityEngine.UI;
+
 public class ButtonExtend : ButtonEx
 {
     public int intInfo = 0;
-    //public bool OnListen { get; set; }
-    public Action<int> OnOneParaClick;
+
+    public Action<int> onceClick;
 
     public override void OnPointerClick(PointerEventData eventData)
     {
         base.OnPointerClick(eventData);
-        if (OnCheckDbClick())
+        if (IsDoubleClick())
         {
             return;
         }
-        if (OnOneParaClick != null) OnOneParaClick(intInfo);
+        if (onceClick != null) onceClick(intInfo);
     }
 
     #region 鍙屽嚮
-    private float dbInterval = 0.3f;
-    private bool m_IsOnDb = false;
+
+    private float doubleClickInterval = 0.3f;
+    private bool m_IsOnDoubleClick = false;
     private bool m_FreezeDbClick = false;
-    public Action m_OnDbClick;
-    private bool OnCheckDbClick()
+    public Action doubleClick;
+
+    private bool IsDoubleClick()
     {
-        if (m_OnDbClick == null)
+        if (doubleClick == null)
         {
             return false;
         }
-        if (m_IsOnDb)
+
+        if (m_IsOnDoubleClick)
         {
             if (!m_FreezeDbClick)
             {
-                m_OnDbClick();
-                m_IsOnDb = false;
+                doubleClick();
+                m_IsOnDoubleClick = false;
                 m_FreezeDbClick = true;
             }
         }
         else
         {
             m_FreezeDbClick = false;
-            m_IsOnDb = true;
+            m_IsOnDoubleClick = true;
         }
-        TimeMgr.Instance.Register(this, OnDbCallback, dbInterval);
+
+        TimeMgr.Instance.Register(this, OnDoubleClickCallback, doubleClickInterval);
         return true;
     }
 
-    private void OnDbCallback(Component comp)
+    private void OnDoubleClickCallback(Component comp)
     {
         if (!m_FreezeDbClick)
         {
-            if (OnOneParaClick != null) OnOneParaClick(intInfo);
+            if (onceClick != null) onceClick(intInfo);
         }
+
         m_FreezeDbClick = false;
-        m_IsOnDb = false;
+        m_IsOnDoubleClick = false;
     }
     #endregion
 
diff --git a/System/KnapSack/New/CommonItemBaisc.cs b/System/KnapSack/New/CommonItemBaisc.cs
index a1bbd5f..73c6592 100644
--- a/System/KnapSack/New/CommonItemBaisc.cs
+++ b/System/KnapSack/New/CommonItemBaisc.cs
@@ -4,14 +4,27 @@
 
 namespace Snxxz.UI
 {
+    public enum ItemCellformat
+    {
+        Format_84x84,
+        Format_80x80,
+        Format_70x70,
+        Format_64x64,
+        None,
+    }
+
     public class CommonItemBaisc : MonoBehaviour
     {
+        [SerializeField] ItemCellformat m_Format;
+        public ItemCellformat format { get { return m_Format; } set { m_Format = value; } }
+
         Image m_BgIcon;
         public Image bgIcon {
             get {
                 if (m_BgIcon == null)
                 {
-                    m_BgIcon = this.transform.GetComponent<Image>("EquipBG");
+                    LoadPrefab();
+                    m_BgIcon = this.transform.GetComponent<Image>("Container_ItemCell/Img_BackGround");
                 }
                 return m_BgIcon;
             }
@@ -22,29 +35,21 @@
             get {
                 if (m_ItemIcon == null)
                 {
-                    m_ItemIcon = this.transform.GetComponent<Image>("ItemIcon");
+                    LoadPrefab();
+                    m_ItemIcon = this.transform.GetComponent<Image>("Container_ItemCell/Img_Icon");
                 }
                 return m_ItemIcon;
             }
         }
 
-        Image m_AuctionIcon;
-        public Image auctionIcon {
-            get {
-                if (m_AuctionIcon == null)
-                {
-                    m_AuctionIcon = this.transform.GetComponent<Image>("Img_Auction");
-                }
-                return m_AuctionIcon;
-            }
-        }
 
         Image m_StateIcon;
         public Image stateIcon {
             get {
                 if (m_StateIcon == null)
                 {
-                    m_StateIcon = this.transform.GetComponent<Image>("stateIcon");
+                    LoadPrefab();
+                    m_StateIcon = this.transform.GetComponent<Image>("Container_ItemCell/Img_State");
                 }
                 return m_StateIcon;
             }
@@ -55,7 +60,8 @@
             get {
                 if (m_CountText == null)
                 {
-                    m_CountText = this.transform.GetComponent<Text>("CountText");
+                    LoadPrefab();
+                    m_CountText = this.transform.GetComponent<Text>("Container_ItemCell/Txt_Count");
                 }
                 return m_CountText;
             }
@@ -66,14 +72,43 @@
             get {
                 if (m_Button == null)
                 {
-                    m_Button = this.GetComponent<Button>();
+                    LoadPrefab();
+                    m_Button = this.GetComponent<Button>("Container_ItemCell");
                 }
                 return m_Button;
             }
         }
 
-        public int itemId { get; private set; }
+        GameObject cellContainer;
+        protected void LoadPrefab()
+        {
+            if (cellContainer == null)
+            {
+                switch (format)
+                {
+                    case ItemCellformat.Format_64x64:
+                        cellContainer = UIUtility.CreateWidget("ItemCell_64", "Container_ItemCell");
+                        break;
+                    case ItemCellformat.Format_70x70:
+                        cellContainer = UIUtility.CreateWidget("ItemCell_70", "Container_ItemCell");
+                        break;
+                    case ItemCellformat.Format_80x80:
+                        cellContainer = UIUtility.CreateWidget("ItemCell_80", "Container_ItemCell");
+                        break;
+                    case ItemCellformat.Format_84x84:
+                        cellContainer = UIUtility.CreateWidget("ItemCell_84", "Container_ItemCell");
+                        break;
+                }
 
+                if (cellContainer != null)
+                {
+                    cellContainer.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one);
+                    cellContainer.transform.SetAsFirstSibling();
+                }
+            }
+        }
+
+        public int itemId { get; private set; }
         PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
         EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
 
@@ -107,8 +142,6 @@
             bgIcon.gameObject.SetActive(true);
             itemIcon.SetSprite(config.IconKey);
             bgIcon.SetItemBackGround(ItemLogicUtility.Instance.GetItemQuality(itemId, useDataDic));
-
-            auctionIcon.gameObject.SetActive(isAuction);
 
             countText.gameObject.SetActive(count > 1);
             if (count > 1)
diff --git a/System/KnapSack/New/DepotWin.cs b/System/KnapSack/New/DepotWin.cs
index 0e9f866..737418e 100644
--- a/System/KnapSack/New/DepotWin.cs
+++ b/System/KnapSack/New/DepotWin.cs
@@ -181,15 +181,15 @@
                     gridCell.itemCell.gameObject.SetActive(true);
                     //pdr ToDo
                     gridCell.itemCell.Init(itemModel, true);
-                    gridCell.itemCellBtn.OnOneParaClick = null;
-                    gridCell.itemCellBtn.m_OnDbClick = null;
-                    gridCell.itemCellBtn.OnOneParaClick=(int info)=>
+                    gridCell.itemCellBtn.onceClick = null;
+                    gridCell.itemCellBtn.doubleClick = null;
+                    gridCell.itemCellBtn.onceClick=(int info)=>
                     {
                         itemTipsModel.SetItemTipsModel(PackType.Warehouse,itemModel.guid,false,true);
                         itemTipsModel.SetDepotTipsBtn(itemTipsModel.curAttrData);
                         itemTipsModel.ShowUICtrl();
                     };
-                    gridCell.itemCellBtn.m_OnDbClick = () =>
+                    gridCell.itemCellBtn.doubleClick = () =>
                     {
                         ItemOperateUtility.Instance.TakeOutFromWarehouse(ItemOperateType.putOut, itemModel.guid);
                     };
diff --git a/System/KnapSack/New/GridCell.cs b/System/KnapSack/New/GridCell.cs
index 47b245e..d0f451f 100644
--- a/System/KnapSack/New/GridCell.cs
+++ b/System/KnapSack/New/GridCell.cs
@@ -9,12 +9,12 @@
 {
     public class GridCell : MonoBehaviour
     {
-        private ItemCell _itemCell;
-        public ItemCell itemCell {
+        private BagItemCell _itemCell;
+        public BagItemCell itemCell {
             get
             {
                 if(_itemCell == null)
-                    _itemCell = transform.Find("ItemCell").GetComponent<ItemCell>();
+                    _itemCell = transform.Find("ItemCell").GetComponent<BagItemCell>();
                 return _itemCell;
             }
         }
@@ -28,7 +28,7 @@
         public Image cdImag {get { return _cdImage ?? (_cdImage = transform.Find("CDImag").GetComponent<Image>()); }}
 
         private ButtonExtend _itemCellBtn;
-        public ButtonExtend itemCellBtn { get { return _itemCellBtn ?? (_itemCellBtn = transform.Find("ItemCell").GetComponent<ButtonExtend>()); } }
+        public ButtonExtend itemCellBtn { get { return _itemCellBtn ?? (_itemCellBtn = transform.Find("ItemCell/Container_ItemCell").GetComponent<ButtonExtend>()); } }
 
         private Button _lockBtn;
         public Button lockBtn { get { return _lockBtn ?? (_lockBtn = transform.Find("GridLock").GetComponent<Button>()); } }
@@ -40,10 +40,7 @@
         }
 
 
-
         private ItemModel itemModel = null;
-
-        PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
 
         public void SetModel(ItemModel itemModel)
         {
diff --git a/System/KnapSack/New/ItemCell.cs b/System/KnapSack/New/ItemCell.cs
index c532cfc..7cefbf1 100644
--- a/System/KnapSack/New/ItemCell.cs
+++ b/System/KnapSack/New/ItemCell.cs
@@ -6,6 +6,7 @@
 
 namespace Snxxz.UI
 {
+
     public class ItemCell : CommonItemBaisc
     {
         private Button m_Reducebtn;
@@ -13,7 +14,8 @@
             get {
                 if (m_Reducebtn == null)
                 {
-                    m_Reducebtn = this.transform.GetComponent<Button>("Reducebtn");
+                    LoadPrefab();
+                    m_Reducebtn = this.transform.GetComponent<Button>("Container_ItemCell/Btn_Reduce");
                 }
                 return m_Reducebtn;
             }
diff --git a/System/Strengthening/GodBeastChildNodes.cs b/System/Strengthening/GodBeastChildNodes.cs
index 9276f0c..0163ff0 100644
--- a/System/Strengthening/GodBeastChildNodes.cs
+++ b/System/Strengthening/GodBeastChildNodes.cs
@@ -47,7 +47,6 @@
             ItemModel itemModel = playerPack.GetItemByIndex(PackType.DogzItem, Index);
             m_ItemCell.Init(itemModel);
             m_ItemCell.countText.gameObject.SetActive(false);
-            m_ItemCell.auctionIcon.gameObject.SetActive(false);
             var IudetDogzEquipPlus = itemModel.GetUseData((int)ItemUseDataKey.dogzEquipPlus);// 绁炲吔瑁呭寮哄寲淇℃伅鍒楄〃 [寮哄寲绛夌骇, 寮哄寲鐔熺粌搴
             TextNumber.gameObject.SetActive(false);
             if (IudetDogzEquipPlus != null)
diff --git a/System/Strengthening/WingsRefined.cs b/System/Strengthening/WingsRefined.cs
index 4302798..583bbfd 100644
--- a/System/Strengthening/WingsRefined.cs
+++ b/System/Strengthening/WingsRefined.cs
@@ -166,14 +166,14 @@
                 _ChildNodes._ItemIcon.SetActive(true);
                 ItemModel model = playerPack.GetItemByIndex(PackType.Item, intPetAbsorbTyp[cellCount - 1]);
                 _ChildNodes._ItemIcon.GetComponent<ItemCell>().Init(model);
-                _ChildNodes._ItemButton.OnOneParaClick = null;
+                _ChildNodes._ItemButton.onceClick = null;
                 if (_DevourDIc.ContainsKey(intPetAbsorbTyp[cellCount - 1]))
                 {
                     _ChildNodes._Elect.SetActive(true);
 
                 }
 
-                _ChildNodes._ItemButton.OnOneParaClick = (int info) =>
+                _ChildNodes._ItemButton.onceClick = (int info) =>
                 {
                     if (_ChildNodes._Elect.activeSelf)
                     {
diff --git a/UI/Common/UIPrefabLoader.cs b/UI/Common/UIPrefabLoader.cs
new file mode 100644
index 0000000..96aa320
--- /dev/null
+++ b/UI/Common/UIPrefabLoader.cs
@@ -0,0 +1,53 @@
+锘�//--------------------------------------------------------
+//    [Author]:           绗簩涓栫晫
+//    [  Date ]:           Tuesday, March 19, 2019
+//--------------------------------------------------------
+using UnityEngine;
+using System.Collections;
+
+namespace Snxxz.UI
+{
+    [ExecuteInEditMode]
+    [RequireComponent(typeof(RectTransform))]
+    public class UIPrefabLoader : MonoBehaviour
+    {
+        [SerializeField] string m_PrefabName;
+        public string prefabName { get { return m_PrefabName; } }
+
+        GameObject instance;
+
+        [ExecuteInEditMode]
+        private void Awake()
+        {
+            Create();
+        }
+
+        [ContextMenu("Create")]
+        public void Create()
+        {
+            if (instance != null)
+            {
+                return;
+            }
+
+            if (string.IsNullOrEmpty(m_PrefabName))
+            {
+                return;
+            }
+
+            var find = this.transform.Find(m_PrefabName);
+            if (find)
+            {
+                return;
+            }
+
+            instance = UIUtility.CreateWidget(m_PrefabName, m_PrefabName);
+            instance.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one);
+        }
+
+    }
+
+}
+
+
+
diff --git a/UI/Common/UIPrefabLoader.cs.meta b/UI/Common/UIPrefabLoader.cs.meta
new file mode 100644
index 0000000..216b9fd
--- /dev/null
+++ b/UI/Common/UIPrefabLoader.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: dabca296a3c10864b8107dca62b132e4
+timeCreated: 1552974474
+licenseType: Pro
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

--
Gitblit v1.8.0