예제 #1
0
        public override bool Init(UWarGoodsStoreView _viewParent)
        {
            if (BuyBtn == null)
            {
                Transform BuyTrans = this.GetTransform.FindChild("BtnBuy");
                if (BuyTrans == null)
                {
                    Trace.LogError("没找到对象名为:BtnBuy 的按钮");
                }
                BuyBtn = BuyTrans.GetComponent <Button>();
            }


            if (BuyBtn == null)
            {
                Trace.LogError("对象名为:BuyBtn 没找到Button组件");
            }
            else
            {
                BuyBtn.onClick.AddListener(_viewParent.OnBtnBuyClick);
                SetBuyBtnEnable(false);
            }


            return(base.Init(_viewParent));
        }
예제 #2
0
        protected void UpdateView(UWarGoodsStoreItem _nParam)
        {
            if (_nParam == null || _nParam.SchemeGoodsInfo == null)
            {
                return;
            }

            UWarGoodsStoreView.GetWarGoodsIcon(_nParam.SchemeGoodsInfo.GoodsIconID, GoodsIcon);
            GoodsCost.text = _nParam.GoodsCost.ToString();
            GoodsName.text = _nParam.SchemeGoodsInfo.GoodsName;

            string des = _nParam.SchemeGoodsInfo.GoodsDes;

            UBBProperty.GetInstance().getRatio(des);
            U3D_Render.Common.UBB.toHtml(ref des, UBB_FORMAT_TYPE.UGUI);
            GoodsDetailInfo.text = des;
            SetBuyBtnEnable(_nParam.GoodsCanBuy);

            if (DataCenter.LogicDataCenter.warMobaGoodsDataManager.EnableGoodsFilter)
            {
                if (_nParam.IsFiltered)
                {
                    BuyBtn.gameObject.SetActive(false);
                }
                else
                {
                    BuyBtn.gameObject.SetActive(true);
                }
            }
            else
            {
                BuyBtn.gameObject.SetActive(true);
            }
        }
예제 #3
0
        protected virtual void NonAlwaysChangeData(UWarGoodsStoreItem item)
        {
            UWarGoodsStoreView.GetWarGoodsIcon(item.SchemeGoodsInfo != null ? item.SchemeGoodsInfo.GoodsIconID:0, GoodsIcon);



            if (IsTooltipInit() && item.SchemeGoodsInfo != null)
            {
                GoodsTooltips.SetImage(GoodsTooltip_IconParamName, UWarGoodsStoreView.GetWarGoodsIcon(item.SchemeGoodsInfo.GoodsIconID));
                GoodsTooltips.SetText(GoodsTooltip_NameParamName, item.SchemeGoodsInfo.GoodsName);
                string GoodsDes = item.SchemeGoodsInfo.GoodsDes;
                UBBProperty.GetInstance().getRatio(GoodsDes);
                U3D_Render.Common.UBB.toHtml(ref GoodsDes, UBB_FORMAT_TYPE.UGUI);
                GoodsTooltips.SetText(GoodsTooltip_InfoParamName, GoodsDes);

                string GoodsLocIns = item.SchemeGoodsInfo.GoodsLocationInstructions;
                U3D_Render.Common.UBB.toHtml(ref GoodsLocIns, UBB_FORMAT_TYPE.UGUI);
                GoodsTooltips.SetText(GoodsTooltip_LocInstructionsParamName, GoodsLocIns);
            }
            else
            {
                GoodsTooltips.SetImage(GoodsTooltip_IconParamName, null);
                GoodsTooltips.SetText(GoodsTooltip_NameParamName, "");
                GoodsTooltips.SetText(GoodsTooltip_InfoParamName, "");
                GoodsTooltips.SetText(GoodsTooltip_LocInstructionsParamName, "");
            }
        }
예제 #4
0
        public override bool Init(UWarGoodsStoreView _viewParent)
        {
            //if (GoodsLabelDesList == null)
            //    GoodsLabelDesList = GetTransform.FindChild("GoodsLabelFrame").GetComponent<UWarGoodsLabelDesList>();
            if (AllGoodsTile == null)
            {
                AllGoodsTile = GetTransform.FindChild("AllGoodsFrame").GetComponent <UWarGoodsStoreAllGoodsTile>();
            }
            if (AllGoodsTile2 == null)
            {
                AllGoodsTile2 = GetTransform.FindChild("AllGoodsTile2").GetComponent <UWarGoodsStoreAllGoodsTile>();
            }

            if (GoodsLabelDesTree == null)
            {
                GoodsLabelDesTree = GetTransform.FindChild("GoodsLabelFrame").GetComponent <UWarGoodsStoreTreeView>();
                if (GoodsLabelDesTree != null)
                {
                    GoodsLabelDesTree.Start();
                }
            }
            GoodsLabelDesTree.Multiple      = false;
            GoodsLabelDesTree.KeepSelection = false;
            //GoodsLabelDesList.Multiple = false;

            return(base.Init(_viewParent));
        }
예제 #5
0
        public virtual bool Init(UWarGoodsStoreView _viewParent)
        {
            m_MyParent = _viewParent;
            m_MyParent.onMobaGoodsDataSourceChange.AddListener(OnMobaGoodsDataSourceChange);
            m_MyParent.onMobaGoodsClick.AddListener(OnMobaGoodsClick);

            return(true);
        }
예제 #6
0
        public override bool Init(UWarGoodsStoreView _viewParent)
        {
            bool result = base.Init(_viewParent);

            //ToggleListView.isOn = false;
            DispositionListView.gameObject.SetActive(false);
            //ToggleListView.onValueChanged.AddListener(OnToggleListView);
            WarMobaGoodsDataManager.InitHeroDispositionListEvent += SetDispositionListViewData;
            return(result);
        }
예제 #7
0
        public override bool Init(UWarGoodsStoreView _viewParent)
        {
            m_RecommendGoodsGroup = gameObject.GetComponent <UButtonGroup>();
            if (m_RecommendGoodsGroup == null)
            {
                m_RecommendGoodsGroup = gameObject.AddComponent <UButtonGroup>();
            }

            m_RecommendGoodsGroup.SkipInactive = false;
            return(base.Init(_viewParent));
        }
예제 #8
0
        public override bool Init(UWarGoodsStoreView _viewParent)
        {
            for (int i = 0; i < 7; i++)
            {
                m_PurchasedGoodsDataSource.Add(m_nDefaultItem);
            }

            UpdatePurchasedGoodsListData();  // PurchasedGoodsTile.DataSource = m_PurchasedGoodsDataSource;
            AddPurchasedGoodsListListener(); //PurchasedGoodsTile.OnSelect.AddListener(OnMobaGoodsSelected);
                                             //PurchasedGoodsTile.OnDeselect.AddListener(OnAllGoodsOnDeselect);

            InitButtons(_viewParent);

            return(base.Init(_viewParent));
        }
예제 #9
0
        /*
         * public override void OnMobaGoodsSelected(int _nIndex, ListViewItem _itemComponent)
         * {
         *  SelectedPurchasedGoodsSlotID = _nIndex;
         *  SelectedPurchasedGoodsID = PurchasedGoodsTile.DataSource[_nIndex].GoodsID;
         *  m_SelectedPurchasedGoodsComponent = _itemComponent;
         *
         *  m_MyParent.CurrentSelectedGoods = m_PurchasedGoodsDataSource[_nIndex];
         *
         *  if(SelectedPurchasedGoodsID > 0 )
         *  {
         *      if ((_itemComponent as UWarGoodsStoreItemComponent) && (_itemComponent as UWarGoodsStoreItemComponent).GoodsSelectedFrame != null)
         *      {
         *          (_itemComponent as UWarGoodsStoreItemComponent).GoodsSelectedFrame.gameObject.SetActive(true);
         *      }
         *      SetSellRevokedBtnEnable(true);
         *  }
         * }
         */
        private void InitButtons(UWarGoodsStoreView _viewParent)
        {
            if (RevokedBtn == null || SellBtn == null)
            {
                Transform RevokedTrans = this.GetTransform.FindChild("BtnRevoked");
                if (RevokedTrans == null)
                {
                    Trace.LogError("没找到对象名为:RevokedBtn 的撤销按钮");
                }
                RevokedBtn = RevokedTrans.GetComponent <Button>();

                Transform SellTrans = this.GetTransform.FindChild("BtnSell");
                if (SellTrans == null)
                {
                    Trace.LogError("没找到对象名为:SellBtn 的出售按钮");
                }
                SellBtn = SellTrans.GetComponent <Button>();
            }

            if (RevokedBtn == null)
            {
                Trace.LogError("对象名为:RevokedBtn 没找到Button组件");
            }
            else
            {
                if (GameLogicAPI.getCurGameMode() == Game_ManagedDef.EGameMode.EGM_MCAMP)
                {
                    RevokedBtn.gameObject.SetActive(false);
                }
                else
                {
                    RevokedBtn.gameObject.SetActive(true);
                    RevokedBtn.onClick.AddListener(_viewParent.OnBtnRevokedClick);
                }
            }

            if (SellBtn == null)
            {
                Trace.LogError("对象名为:SellBtn 没找到Button组件");
            }
            else
            {
                SellBtn.onClick.AddListener(OnSellBtnClick);
            }

            SetCanRevoked(false);
            SetSellRevokedBtnEnable(false);
        }
예제 #10
0
        protected void InitButtons(UWarGoodsStoreView _viewParent)
        {
            if (BtnPrevious == null)
            {
                Transform BtnPreviousTrans = this.GetTransform.FindChild("BtnPrevious");
                if (BtnPreviousTrans == null)
                {
                    Trace.LogError("没找到对象名为:BtnPrevious 的按钮");
                }
                BtnPrevious = BtnPreviousTrans.GetComponent <Button>();
            }


            if (BtnPrevious == null)
            {
                Trace.LogError("对象名为:BuyBtn 没找到Button组件");
            }
            else
            {
                BtnPrevious.onClick.AddListener(Prev);
            }


            if (BtnNexts == null)
            {
                Transform BtnNextsTrans = this.GetTransform.FindChild("BtnNexts");
                if (BtnNextsTrans == null)
                {
                    Trace.LogError("没找到对象名为:BtnNexts 的按钮");
                }
                BtnNexts = BtnNextsTrans.GetComponent <Button>();
            }


            if (BtnNexts == null)
            {
                Trace.LogError("对象名为:BuyBtn 没找到Button组件");
            }
            else
            {
                BtnNexts.onClick.AddListener(Next);
            }
        }
예제 #11
0
        public override bool Init(UWarGoodsStoreView _viewParent)
        {
            TreeNodeComponentPrefabRes     = AssetBundleManager.GetAssets(AssetType.Asset_Prefab, UPath.UPrefabsPath + "DynamicState_Moba/WarGoodsStore/WarGoodsStoreTreeNodeComponent");
            TreeNodeHorizonalLinePrefabRes = AssetBundleManager.GetAssets(AssetType.Asset_Prefab, UPath.UPrefabsPath + "DynamicState_Moba/WarGoodsStore/WarTreeNodeHorizonalLine");

            m_UnuseTreeNodeContainner = new GameObject("UnuseTreeNode").transform;
            m_UnuseTreeNodeHorizonalLineContainner = new GameObject("UnuseTreeNodeHorizonalLine").transform;

            m_UnuseTreeNodeContainner.SetParent(this.GetTransform, false);
            m_UnuseTreeNodeHorizonalLineContainner.SetParent(this.GetTransform, false);

            m_NodeDefaultHeight = (int)TreeNodeComponentPrefabRes.GetRectTransformRect().height;

            //预先创建一些
            for (int i = 0; i < 10; i++)
            {
                InstantiateTreeNode();
                InstantiateTreeNodeData();
                InstantiateTreeNodeHorizonalLine();
            }

            return(base.Init(_viewParent));
        }
예제 #12
0
 public override bool Init(UWarGoodsStoreView _viewParent)
 {
     InitButtons(_viewParent);
     return(base.Init(_viewParent));
 }