Exemple #1
0
    void Init()
    {
        if (m_parms == null)
        {
            return;
        }

        m_Rewards        = m_parms[0] as List <RewardBase>;
        TitleLabel.text  = (string)m_parms[1];
        RewardLabel.text = (string)m_parms[2];
        if (m_parms.Length >= 4)
        {
            m_reward_ack = (C2G.Reward3Ack)m_parms[3];
        }
        else
        {
            m_reward_ack = null;
        }

        if (m_parms.Length >= 5)
        {
            _OnPopupCloseDelegate = m_parms[4] as OnPopupCloseDelegate;
        }

        Effect.SetActive(m_reward_ack != null);

        foreach (var reward in m_Rewards)
        {
            var reward_item = RewardManager.GetNewObject <RewardItem>(RewardGrid.transform, Vector3.zero);
            reward_item.InitReward(reward);
        }
        RewardGrid.Reposition();
    }
Exemple #2
0
    public override void Init(params object[] parms)
    {
        if (parms == null)
        {
            return;
        }

        m_TweenScale.ResetToBeginning();
        m_TweenScale.Play(true);
        m_Rewards          = parms[0] as List <RewardBase>;
        m_TitleLabel.text  = (string)parms[1];
        m_RewardLabel.text = (string)parms[2];
        if (parms.Length >= 4)
        {
            m_reward_ack = (C2G.Reward3Ack)parms[3];
        }
        else
        {
            m_reward_ack = null;
        }

        if (parms.Length >= 5)
        {
            _OnPopupCloseDelegate = parms[4] as OnPopupCloseDelegate;
        }

        m_Effect.SetActive(m_reward_ack != null);

        foreach (var reward in m_Rewards)
        {
            var reward_item = m_RewardManager.GetNewObject <RewardItem>(m_RewardGrid.transform, Vector3.zero);
            reward_item.InitReward(reward);
        }
        m_RewardGrid.Reposition();
    }
Exemple #3
0
    public void ProcessReward3Ack(C2G.Reward3Ack ack)
    {
        ack.add_goods.ForEach(g => Network.PlayerInfo.AddGoods(g));
        ack.loot_items.ForEach(i => ItemManager.Instance.Add(i));
        ack.loot_runes.ForEach(i => RuneManager.Instance.Add(i));
        Network.Instance.LootCreatures(ack.loot_creatures, ack.loot_creatures_equip);

        GameMain.Instance.UpdatePlayerInfo();
    }
Exemple #4
0
    public void OnMapClearRewardHandler(C2G.MapClearReward packet, C2G.MapClearRewardAck ack)
    {
        m_temp_map_clear_reward_ack = ack.reward_ack;

        Network.Instance.ProcessReward3Ack(ack.reward_ack);
        MapClearRewardManager.Instance.SetReward(packet.map_id, packet.index, packet.difficulty);

        m_SelectedBtn.GetComponent <BoxCollider2D>().enabled = false;

        UIPlayTween tween = m_SelectedBtn.GetComponentInChildren <UIPlayTween>();

        tween.Play(true);
    }