public static bool CanOpenBattleShop(Units player, ShopInfo shopInfo, EBattleShopOpenType openType, out string err)
        {
            err = null;
            bool result = false;

            if (shopInfo != null && null != player && openType == EBattleShopOpenType.eFromButton)
            {
                switch (shopInfo.ShopType)
                {
                case EBattleShopType.eLM:
                    result = (!BattleEquipTools_op.IsOnLineBattle() || Singleton <PvpManager> .Instance.SelfTeamType == TeamType.LM);
                    break;

                case EBattleShopType.eBL:
                    result = (BattleEquipTools_op.IsOnLineBattle() && Singleton <PvpManager> .Instance.SelfTeamType == TeamType.BL);
                    break;

                case EBattleShopType.eNeutral:
                case EBattleShopType.eNeutral_2:
                {
                    bool flag = null != player && BattleEquipTools_op.WithinShopArea(shopInfo, player.transform.position);
                    result = flag;
                    break;
                }

                case EBattleShopType.eTeam3:
                    result = (Singleton <PvpManager> .Instance.SelfTeamType == TeamType.Team_3);
                    break;
                }
            }
            return(result);
        }
 public static void BattleShop_openBattleShop(EBattleShopType shopType, EBattleShopOpenType openType)
 {
     MobaMessageManagerTools.SendClientMsg(ClientV2C.BattleShop_openShop, new object[]
     {
         shopType,
         openType
     }, false);
 }
예제 #3
0
        private void OpenBattleShop(EBattleShopType type, EBattleShopOpenType openType)
        {
            Units    player   = MapManager.Instance.GetPlayer();
            ShopInfo shopInfo = ModelManager.Instance.Get_BattleShop_shopInfo(type);
            string   text;

            if (BattleEquipTools_op.CanOpenBattleShop(player, shopInfo, openType, out text))
            {
                AudioMgr.PlayUI("Play_Shop_Open", null, false, false);
                MsgData_BattleShop_onOP param = new MsgData_BattleShop_onOP
                {
                    shopType = type
                };
                MobaMessageManagerTools.SendClientMsg(ClientC2C.BattleShop_onOP, param, false);
                CtrlManager.OpenWindow(WindowID.BattleEquipmentView, null);
            }
            else if (!string.IsNullOrEmpty(text))
            {
                Singleton <TipView> .Instance.ShowViewSetText(text, 1f);
            }
        }