/// <summary> /// 单个物品获得效果展示 /// </summary> /// <param name="goods"></param> /// <param name="sender"></param> public void PlayAddGameGoodsEffect(GameGoodData goods, GameObject sender) { GoodsType reward = goods.type; BigInteger reward_count = goods.count; int reward_type = goods.param; switch (reward) { case GoodsType.CARD: case GoodsType.CARD_CHIP: { //UIMgr.singleton.FindUIObject<ResourceUI>().PlayCollectCardAnim //(reward, reward_type, reward_count, sender.transform.position); } break; case GoodsType.GOLD: case GoodsType.DIAMOND: case GoodsType.KEY: { int rewardEfCount = reward_count > int.MaxValue ? int.MaxValue : (int)reward_count; Global.gApp.gMsgDispatcher.Broadcast(MsgIds.ShowRewardGetEffect, reward, reward_count, sender.transform.position); } break; } }
public GameGoodData GetBoxCost(int boxID, int times) { var boxRes = TableMgr.singleton.BoxTable.GetItemByID(boxID); if (boxRes == null) { return(null); } var data = new GameGoodData(); if (PlayerDataMgr.singleton.GetCurrency((CurrencyType)boxRes.key) >= times) { data.type = GoodsType.KEY; data.count = times; } else { if (times == 10) { data.count = TableMgr.singleton.ValueTable.open_box_ten_cost; } else { data.count = times * boxRes.cost; } if (boxRes.type == 1) { data.type = GoodsType.DIAMOND; } else if (boxRes.type == 2) { data.type = GoodsType.GOLD; } } return(data); }