Beispiel #1
0
    void RequestKingsGift()
    {
        C2G.KingsGiftRefresh packet = new C2G.KingsGiftRefresh();
        packet.last_map_id = MapInfoManager.Instance.GetInfoByIdn(MapClearDataManager.Instance.GetLastMainStage().map_idn).ID;
        Network.GameServer.JsonAsync <C2G.KingsGiftRefresh, C2G.KingsGiftRefreshAck>(packet, OnKingsGift);

        m_KingsRewardTween.onFinished = new List <EventDelegate>();
    }
Beispiel #2
0
    void OnKingsGift(C2G.KingsGiftRefresh send, C2G.KingsGiftRefreshAck recv)
    {
        m_KingsReward.SetActive(false);
        m_KingsRewardTween.ResetToBeginning();
        if (recv.got_info.goods_type != PacketInfo.pe_GoodsType.invalid)
        {
            List <RewardBase> reward = new List <RewardBase>();
            reward.Add(new RewardBase(40000 + (int)recv.got_info.goods_type, (int)recv.got_info.goods_value));
            Popup.Instance.Show(ePopupMode.Reward, reward, Localization.Get("PopupRewardTitle"), Localization.Get("GetThisRewards"));
        }
        is_expire = false;

        Network.PlayerInfo.AddGoodsValue(Network.PlayerInfo.kings_gift.reward_data.goods_type, Network.PlayerInfo.kings_gift.reward_data.goods_value);
        GameMain.Instance.UpdatePlayerInfo();
        m_Button.SetActive(true);
        Network.PlayerInfo.kings_gift = recv.next_info;
        Init();
    }