Ejemplo n.º 1
0
    void InitItem()
    {
        uint itemId = DataManager.Manager <DailyTestManager>().FuRuiZhuItemId;

        if (itemId == 0)
        {
            return;
        }

        if (m_baseGrid != null)
        {
            if (this.baseItem == null)
            {
                this.baseItem = new BaseItem(itemId);
            }

            m_baseGrid.Reset();
            m_baseGrid.SetBorder(true, this.baseItem.BorderIcon);
            m_baseGrid.SetIcon(true, this.baseItem.Icon);
            int itemCount = DataManager.Manager <ItemManager>().GetItemNumByBaseId(itemId);//道具存量
            m_baseGrid.SetNum(true, itemCount.ToString());

            //获取途径
            if (itemCount < 1)
            {
                m_baseGrid.SetNotEnoughGet(true);
                m_baseGrid.RegisterUIEventDelegate(UIItemInfoEventDelegate);
            }
            else
            {
                m_baseGrid.SetNotEnoughGet(false);
                m_baseGrid.UnRegisterUIEventDelegate();
            }
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="baseGridObj"></param>
 protected void InitItemInfoGrid(Transform baseGridTs, bool reset = false)
 {
     if (null == baseGridTs)
     {
         return;
     }
     m_baseGrid = baseGridTs.GetComponent <UIItemInfoGrid>();
     if (null == m_baseGrid)
     {
         m_baseGrid = baseGridTs.gameObject.AddComponent <UIItemInfoGrid>();
     }
     if (null != m_baseGrid)
     {
         if (reset)
         {
             m_baseGrid.Reset();
         }
         //m_baseGrid.SetTriggerEffect(true, (int)UIBase.UITriggerEffectType.Scale);
         m_baseGrid.RegisterUIEventDelegate(InfoGridUIEventDlg);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="baseGrid"></param>
 protected void InitItemInfoGrid(UIItemInfoGrid baseGrid)
 {
     if (null == baseGrid)
     {
         return;
     }
     this.m_baseGrid = baseGrid;
     if (null != m_baseGrid)
     {
         //m_baseGrid.SetTriggerEffect(true, (int)UIBase.UITriggerEffectType.Scale);
         m_baseGrid.RegisterUIEventDelegate(InfoGridUIEventDlg);
     }
 }
Ejemplo n.º 4
0
    private void InitWidgets()
    {
        RegisterGlobalUIEvent(true);
        Transform cloneObj = null;

        if (null != m_trans_MallBaseGridRoot)
        {
            cloneObj = m_trans_MallBaseGridRoot.GetChild(0);
        }
        if (null != cloneObj && null == m_mallItemBaseGrid)
        {
            if (null != cloneObj)
            {
                m_mallItemBaseGrid = cloneObj.GetComponent <UIItemInfoGrid>();
                if (null == m_mallItemBaseGrid)
                {
                    m_mallItemBaseGrid = cloneObj.gameObject.AddComponent <UIItemInfoGrid>();
                }
                if (null != m_mallItemBaseGrid)
                {
                    m_mallItemBaseGrid.RegisterUIEventDelegate((eventType, data, param) =>
                    {
                        if (eventType == UIEventType.Click)
                        {
                            if (null != CurrentMallData && null != CurrentMallData.LocalItem)
                            {
                                TipsManager.Instance.ShowItemTips(CurrentMallData.LocalItem);
                            }
                        }
                    });
                }
            }
            m_trans_MallBaseGridRoot.localScale = new Vector3(0.9f, 0.9f, 0.9f);
        }

        if (null != m_ctor_CategoryTagContent && null != m_trans_UITabGrid)
        {
            m_ctor_CategoryTagContent.RefreshCheck();
            m_ctor_CategoryTagContent.Initialize <UITabGrid>(m_trans_UITabGrid.gameObject, OnUpdateMallGridData, OnGridUIEventDlg);
        }


        if (null != m_ctor_MallScrollView && null != m_trans_UIMallGrid)
        {
            m_ctor_MallScrollView.Initialize <UIMallGrid>(m_trans_UIMallGrid.gameObject
                                                          , OnUpdateMallGridData, OnGridUIEventDlg);
        }
    }
Ejemplo n.º 5
0
    /// <summary>
    /// 道具详情
    /// </summary>
    /// <param name="itemId"></param>
    void ItemInfoDisplay(uint itemId)
    {
        ItemDataBase itemDataBase = GameTableManager.Instance.GetTableItem <ItemDataBase>(itemId);

        if (itemDataBase == null)
        {
            return;
        }

        if (m_trans_ItemInfoRoot.childCount == 0)
        {
            GameObject preObj   = UIManager.GetResGameObj(GridID.Uiiteminfogrid) as GameObject;
            GameObject cloneObj = NGUITools.AddChild(m_trans_ItemInfoRoot.gameObject, preObj);
            if (null != cloneObj)
            {
                m_baseGrid = cloneObj.GetComponent <UIItemInfoGrid>();
                if (null == m_baseGrid)
                {
                    m_baseGrid = cloneObj.AddComponent <UIItemInfoGrid>();
                }
            }
        }


        BaseItem baseItem  = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(itemDataBase.itemID);
        int      itemCount = DataManager.Manager <ItemManager>().GetItemNumByBaseId(itemDataBase.itemID);//道具存量

        m_baseGrid.Reset();
        m_baseGrid.SetBorder(true, baseItem.BorderIcon);
        m_baseGrid.SetIcon(true, baseItem.Icon);
        m_baseGrid.SetNum(true, itemCount.ToString());
        if (itemCount < 1)
        {
            m_baseGrid.SetNotEnoughGet(true);
            m_baseGrid.RegisterUIEventDelegate(UIItemInfoEventDelegate);
        }
        else
        {
            m_baseGrid.SetNotEnoughGet(false);
            m_baseGrid.UnRegisterUIEventDelegate();
        }

        m_label_ItemName.text  = itemDataBase.itemName;
        m_label_ItemDes.text   = itemDataBase.description;
        m_label_ItemLevel.text = string.Format("物品使用等级:{0}", itemDataBase.useLevel);
    }
Ejemplo n.º 6
0
    void InitItem()
    {
        if (m_baseGrid != null)
        {
            m_baseGrid.Reset();
            m_baseGrid.SetBorder(true, this.baseItem.BorderIcon);
            m_baseGrid.SetIcon(true, this.baseItem.Icon);
            //m_baseGrid.SetNum(true, this.itemCount.ToString());

            //获取途径
            if (itemCount < 1)
            {
                m_baseGrid.SetNotEnoughGet(true);
                m_baseGrid.RegisterUIEventDelegate(UIItemInfoEventDelegate);
            }
            else
            {
                m_baseGrid.SetNotEnoughGet(false);
                m_baseGrid.UnRegisterUIEventDelegate();
            }
        }
    }
Ejemplo n.º 7
0
    void InitItem()
    {
        if (m_baseGrid != null)
        {
            BaseItem baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(m_reNameItemId);
            itemCount = DataManager.Manager <ItemManager>().GetItemNumByBaseId(this.m_reNameItemId);//道具存量

            m_baseGrid.Reset();
            m_baseGrid.SetBorder(true, baseItem.BorderIcon);
            m_baseGrid.SetIcon(true, baseItem.Icon);
            m_baseGrid.SetNum(false);

            string itemCountStr = string.Empty;

            //获取途径
            if (itemCount < 1)
            {
                m_baseGrid.SetNotEnoughGet(true);
                m_baseGrid.RegisterUIEventDelegate(UIItemInfoEventDelegate);

                itemCountStr = ColorManager.GetColorString(ColorType.Red, itemCount.ToString());
            }
            else
            {
                m_baseGrid.SetNotEnoughGet(false);
                m_baseGrid.UnRegisterUIEventDelegate();

                itemCountStr = ColorManager.GetColorString(ColorType.White, itemCount.ToString());
            }

            //数量
            m_label_ItemCount.text = string.Format("{0}/1", itemCountStr);

            //名字
            m_label_ItemName.text = baseItem.LocalName;
        }
    }
Ejemplo n.º 8
0
    private void InitWidgets()
    {
        dic = DataManager.Manager <Mall_NpcShopManager>().Tabs;
        RegisterGlobalUIEvent(true);
        GameObject preObj = m_trans_UIItemInfoGrid.gameObject;

        if (null != preObj && null != m_trans_MallBaseGridRoot && null == m_mallItemBaseGrid)
        {
            GameObject cloneObj = NGUITools.AddChild(m_trans_MallBaseGridRoot.gameObject, preObj);
            if (null != cloneObj)
            {
                m_mallItemBaseGrid = cloneObj.GetComponent <UIItemInfoGrid>();
                if (null == m_mallItemBaseGrid)
                {
                    m_mallItemBaseGrid = cloneObj.AddComponent <UIItemInfoGrid>();
                }
                if (null != m_mallItemBaseGrid)
                {
                    m_mallItemBaseGrid.RegisterUIEventDelegate((eventType, data, param) =>
                    {
                        if (eventType == UIEventType.Click)
                        {
                            if (null != CurrentMallData && null != CurrentMallData.LocalItem)
                            {
                                TipsManager.Instance.ShowItemTips(CurrentMallData.LocalItem);
                            }
                        }
                    });
                }
            }
            m_trans_MallBaseGridRoot.localScale = new Vector3(0.9f, 0.9f, 0.9f);
        }
        if (null != m_trans_PurchaseCostGrid)
        {
            if (null == m_trans_PurchaseCostGrid.GetComponent <UICurrencyGrid>())
            {
                m_trans_PurchaseCostGrid.gameObject.AddComponent <UICurrencyGrid>();
            }
        }
        if (null != m_trans_OwnMoneyGrid)
        {
            if (null == m_trans_OwnMoneyGrid.GetComponent <UICurrencyGrid>())
            {
                m_trans_OwnMoneyGrid.gameObject.AddComponent <UICurrencyGrid>();
            }
        }

        if (null != m_ctor_MallScrollView)
        {
            if (null == m_trans_PurchaseCostGrid.GetComponent <UICurrencyGrid>())
            {
                m_trans_PurchaseCostGrid.gameObject.AddComponent <UICurrencyGrid>();
            }
            if (null == m_trans_OwnMoneyGrid.GetComponent <UICurrencyGrid>())
            {
                m_trans_OwnMoneyGrid.gameObject.AddComponent <UICurrencyGrid>();
            }
        }

        if (null != m_ctor_CategoryTagContent)
        {
            m_ctor_CategoryTagContent.RefreshCheck();
            m_ctor_CategoryTagContent.Initialize <UITabGrid>(m_trans_UITabGrid.gameObject, OnUpdateMallGridData, OnGridUIEventDlg);
        }

        if (null != m_ctor_RightTabRoot)
        {
            List <string> m_lstDepende = new List <string>();
            m_ctor_RightTabRoot.RefreshCheck();
            m_ctor_RightTabRoot.Initialize <UIToggleGrid>(m_trans_TogglePanel.gameObject, OnUpdateMallGridData, OnGridUIEventDlg);
        }

        if (null != m_ctor_MallScrollView)
        {
            m_ctor_MallScrollView.RefreshCheck();
            m_ctor_MallScrollView.Initialize <UIMallGrid>(m_trans_UIMallGrid.gameObject, OnUpdateMallGridData, OnGridUIEventDlg);
        }
    }
Ejemplo n.º 9
0
    private void InitWidgets()
    {
        Transform cloneObj = null;// UIManager.GetObj((uint)GridID.Uiiteminfogrid);

        if (null != m_trans_ItemBaseGridRoot)
        {
            cloneObj = m_trans_ItemBaseGridRoot.GetChild(0);
        }
        if (null != cloneObj && null == m_exchangeItemBaseGrid)
        {
            m_exchangeItemBaseGrid = cloneObj.GetComponent <UIItemInfoGrid>();
            if (null == m_exchangeItemBaseGrid)
            {
                m_exchangeItemBaseGrid = cloneObj.gameObject.AddComponent <UIItemInfoGrid>();
            }
            if (null != m_exchangeItemBaseGrid)
            {
                m_exchangeItemBaseGrid.RegisterUIEventDelegate((eventType, data, param) =>
                {
                    if (eventType == UIEventType.Click)
                    {
                        //if (null != CurrentMallData && null != CurrentMallData.LocalItem)
                        //{
                        //    TipsManager.Instance.ShowItemTips(CurrentMallData.LocalItem);
                        //}
                    }
                });
            }
            m_trans_ItemBaseGridRoot.localScale = new Vector3(0.9f, 0.9f, 0.9f);
        }

        if (null != m_ctor_RightTabRoot && null != m_trans_TogglePanel)
        {
            m_ctor_RightTabRoot.Initialize <UITabGrid>(m_trans_TogglePanel.gameObject
                                                       , (gridBase, index) =>
            {
                UITabGrid gGRid = gridBase as UITabGrid;
                if (null != gGRid)
                {
                    Category tc = category.ChildCategoryData[index];
                    gGRid.SetGridData(tc.Id);
                    gGRid.SetName(tc.Name);
                    gGRid.SetHightLight((tc.Id == selectfTabID));
                }
            }
                                                       , (eventType, data, param) =>
            {
                if (eventType == UIEventType.Click)
                {
                    UITabGrid gGRid = data as UITabGrid;
                    SetFirstActiveTab((uint)gGRid.Data);
                }
            });
        }


        if (null != m_ctor_CategoryTagContent && null != m_trans_UITabGrid)
        {
            m_ctor_CategoryTagContent.Initialize <UITabGrid>(m_trans_UITabGrid.gameObject, OnGridUpdate, OnGridEventDlg);
        }

        if (null != m_ctor_ExchangeScrollView && null != m_trans_UIExchangeGrid)
        {
            m_ctor_ExchangeScrollView.Initialize <UIExchangeGrid>(m_trans_UIExchangeGrid.gameObject, OnGridUpdate, OnGridEventDlg);
        }
    }
Ejemplo n.º 10
0
    private void InitWidgets()
    {
        RegisterGlobalUIEvent(true);
        Transform cloneObj = null;// UIManager.GetObj((uint)GridID.Uiiteminfogrid);

        if (null != m_trans_MallBaseGridRoot)
        {
            cloneObj = m_trans_MallBaseGridRoot.GetChild(0);
        }
        if (null != cloneObj && null == m_mallItemBaseGrid)
        {
            //Util.AddChildToTarget(m_trans_MallBaseGridRoot, cloneObj);
            if (null != cloneObj)
            {
                m_mallItemBaseGrid = cloneObj.GetComponent <UIItemInfoGrid>();
                if (null == m_mallItemBaseGrid)
                {
                    m_mallItemBaseGrid = cloneObj.gameObject.AddComponent <UIItemInfoGrid>();
                }
                if (null != m_mallItemBaseGrid)
                {
                    m_mallItemBaseGrid.RegisterUIEventDelegate((eventType, data, param) =>
                    {
                        if (eventType == UIEventType.Click)
                        {
                            if (null != CurrentMallData && null != CurrentMallData.LocalItem)
                            {
                                TipsManager.Instance.ShowItemTips(CurrentMallData.LocalItem);
                            }
                        }
                    });
                }
            }
            m_trans_MallBaseGridRoot.localScale = new Vector3(0.9f, 0.9f, 0.9f);
        }
        if (null == m_currency && null != m_trans_PurchaseCostGrid)
        {
            m_currency = m_trans_PurchaseCostGrid.GetComponent <UICurrencyGrid>();
            if (null == m_currency)
            {
                m_currency = m_trans_PurchaseCostGrid.gameObject.AddComponent <UICurrencyGrid>();
            }
        }


        if (null != m_ctor_CategoryTagContent && null != m_trans_UITabGrid)
        {
            m_ctor_CategoryTagContent.RefreshCheck();
            //m_ctor_CategoryTagContent.Initialize<UITabGrid>((uint)GridID.Uitabgrid
            //    , UIManager.OnObjsCreate, UIManager.OnObjsRelease, OnUpdateMallGridData, OnGridUIEventDlg);
            m_ctor_CategoryTagContent.Initialize <UITabGrid>(m_trans_UITabGrid.gameObject, OnUpdateMallGridData, OnGridUIEventDlg);
        }


        if (null != m_ctor_MallScrollView && null != m_trans_UIMallGrid)
        {
            //m_ctor_MallScrollView.Initialize<UIMallGrid>((uint)GridID.Uimallgrid
            //                        , UIManager.OnObjsCreate, UIManager.OnObjsRelease
            //                        , OnUpdateMallGridData, OnGridUIEventDlg);
            m_ctor_MallScrollView.Initialize <UIMallGrid>(m_trans_UIMallGrid.gameObject
                                                          , OnUpdateMallGridData, OnGridUIEventDlg);
        }

        //皇令
        if (m_ctor_NobleContentRoot != null && null != m_trans_UINobleGrid)
        {
            //m_ctor_NobleContentRoot.Initialize<UINobleGrid>((uint)GridID.Uinoblegrid, UIManager.OnObjsCreate, UIManager.OnObjsRelease
            //    , OnNobleGridDataUpdate, OnNobleGridEvent);
            m_ctor_NobleContentRoot.Initialize <UINobleGrid>(m_trans_UINobleGrid.gameObject, OnNobleGridDataUpdate, OnNobleGridEvent);
        }


        //充值
        if (null == m_blockGridCreator && null != m_trans_RechargeScrollView && null != m_trans_UIRechargeGrid)
        {
            m_blockGridCreator = m_trans_RechargeScrollView.GetComponent <BlockGridScrollView>();
            if (m_blockGridCreator == null)
            {
                m_blockGridCreator = m_trans_RechargeScrollView.gameObject.AddComponent <BlockGridScrollView>();
                m_blockGridCreator.Initialize <UIRechargeGrid>(
                    m_trans_UIRechargeGrid.gameObject
                    , m_trans_UIBlockIndexGrid.gameObject
                    , new UnityEngine.Vector2(2, 3)
                    , new UnityEngine.Vector2(350, 249)
                    , OnRechargeGridDataUpdate
                    , OnRechargeGridEvent
                    , new Vector3(0, -10, 0)
                    , UnityEngine.Vector2.zero
                    , pageGap: 1164);
            }
        }
    }