Exemplo n.º 1
0
    public void Initialize(MasterMedalPrizeParam _master)
    {
        MasterItemParam prize_item = DataManager.Instance.masterItem.list.Find(p => p.item_id == _master.prize_item_id);

        m_txtPrizeName.text   = prize_item.name;
        m_imgPrizeItem.sprite = SpriteManager.Instance.Get(prize_item.sprite_name);
        MasterItemParam master_token_item = DataManager.Instance.masterItem.list.Find(p => p.item_id == _master.item_id_medal);

        m_imgPrizeToken.sprite = SpriteManager.Instance.Get(master_token_item.sprite_name);
        DataItemParam data_token_item = DataManager.Instance.dataItem.list.Find(p => p.item_id == _master.item_id_medal);

        int token_num = 0;

        if (data_token_item != null)
        {
            token_num = data_token_item.num;
        }
        //Debug.Log(_master.medal_num);
        if (_master.medal_num <= token_num)
        {
            m_txtCost.text = string.Format("{0} → {1}", token_num, token_num - _master.medal_num);

            m_btnYes.interactable = true;
        }
        else
        {
            m_txtCost.text        = "<color=red>メダルが足りません</color>";
            m_btnYes.interactable = false;
        }
    }
Exemplo n.º 2
0
        public override void OnEnter()
        {
            base.OnEnter();
            campMain.m_medalPrizeBuyCheck.gameObject.SetActive(true);
            MasterMedalPrizeParam prize = DataManager.Instance.masterMedalPrize.list.Find(p => p.medal_prize_id == medal_prize_id.Value);

            campMain.m_medalPrizeBuyCheck.Initialize(prize);
        }
Exemplo n.º 3
0
        public override void OnEnter()
        {
            base.OnEnter();

            MasterMedalPrizeParam prize = DataManager.Instance.masterMedalPrize.list.Find(p => p.medal_prize_id == medal_prize_id.Value);

            DataItemParam medal_param = DataManager.Instance.dataItem.list.Find(p => p.item_id == prize.item_id_medal);

            medal_param.num -= prize.medal_num;

            DataManager.Instance.dataItem.AddItem(prize.prize_item_id, 1);

            DataManager.Instance.dataItem.Save();

            Finish();
        }
Exemplo n.º 4
0
    public void Initialize(MasterMedalPrizeParam _master)
    {
        MasterItemParam prize_item = DataManager.Instance.masterItem.list.Find(p => p.item_id == _master.prize_item_id);

        m_txtPrizeName.text   = prize_item.name;
        m_imgPrizeItem.sprite = SpriteManager.Instance.Get(prize_item.sprite_name);



        MasterItemParam master_token_item = DataManager.Instance.masterItem.list.Find(p => p.item_id == _master.item_id_medal);
        DataItemParam   data_token_item   = DataManager.Instance.dataItem.list.Find(p => p.item_id == _master.item_id_medal);

        m_txtExchange.text = string.Format("{0}必要枚数[{1}]", master_token_item.name, _master.medal_num);

        int token_num = 0;

        if (data_token_item != null)
        {
            token_num = data_token_item.num;
        }
        m_txtMedalNum.text = string.Format("所持{0}:{1}枚", master_token_item.name, token_num);


        DataItemParam data_item_param = DataManager.Instance.dataItem.list.Find(p => p.item_id == _master.prize_item_id);

        int item_num = 0;

        if (data_item_param != null)
        {
            item_num = data_item_param.num;
        }

        m_txtItemNum.text = string.Format("所持数{0}", item_num);

        m_iMedalPrizeId = _master.medal_prize_id;
        btn.onClick.AddListener(() =>
        {
            OnMedalPrizeId.Invoke(m_iMedalPrizeId);
        });
    }