/// <summary> /// 最大购买次数; /// </summary> /// <returns></returns> public int GetMaxCount() { ////-----根据人物当前资源最大购买次数-------- //int countByMoney = -1; //long count = -1; //if(ObjectSelf.GetInstance().TryGetResourceCountById(ShopT.getCostType(), ref count)) //{ // countByMoney = (int)(count / perPrice); //} //int vipLv = ObjectSelf.GetInstance().VipLevel; //Shopbuy sb = ObjectSelf.GetInstance().GetShopBuyInfoByShopId(ShopT.getId()); ////-----根据人物当前vip每日限购最大购买次数-- //int countByDaily = -1; ////-----根据人物当前vip总限购最大购买次数---- //int countByTotal = -1; //if(DataTemplate.GetInstance().IsShopBuyLimited(ShopT)) //{ // countByDaily = DataTemplate.GetInstance().GetShopItemDailyBuyTimes(ShopT, vipLv) - sb.todaynum; // countByTotal = DataTemplate.GetInstance().GetShopItemDailyBuyTimes(ShopT, vipLv) - sb.buyallnum; //} //int[] times = new int[3]; //times[0] = countByMoney; //times[1] = countByDaily; //times[0] = countByTotal; //return Mathf.Max(0, Mathf.Min(times)); return(ShopModule.GetMaxBuyCount(ShopT.getId(), perPrice)); }