예제 #1
0
        private void OnEnable()
        {
            if (m_iSelectingItemSerial.Value == 0)
            {
                return;
            }
            m_dataItemParam   = DataManager.Instance.m_dataItem.list.Find(p => p.item_serial == m_iSelectingItemSerial.Value);
            m_masterItemParam = DataManager.Instance.m_masterItem.list.Find(p => p.item_id == m_dataItemParam.item_id);

            m_headerBanner.Initialize(m_dataItemParam);

            m_btnUse.gameObject.SetActive(m_masterItemParam.field);

            m_txtDescription.text = m_masterItemParam.description;

            // 味方全体の場合はいきなり使うボタンが押せる
            if (m_masterItemParam.item_target == "friendall")
            {
                m_btnUse.interactable = true;
            }
            else if (m_masterItemParam.item_target == "friendone")
            {
                m_btnUse.interactable = false;
                m_fieldMenu.OnDataUnitParam.AddListener(SelectCardUnit);
            }
            else
            {
                Debug.LogError($"okashi_item_target:{m_masterItemParam.item_target}");
            }
        }
예제 #2
0
        public void ShowItem()
        {
            m_iSelectingItemSerial.Value = 0;

            RPGKitUtil.DeleteObjects <EquipBanner>(m_tfRootBanner.gameObject);
            RPGKitUtil.DeleteObjects <BannerItem>(m_tfRootBanner.gameObject);
            m_itemBannerList.Clear();

            foreach (DataItemParam data in DataManager.Instance.m_dataItem.list)
            {
                GameObject objItem = Instantiate(m_prefBannerItem, m_tfRootBanner) as GameObject;
                objItem.SetActive(true);
                BannerItem banner = objItem.GetComponent <BannerItem>();
                banner.Initialize(data);
                m_itemBannerList.Add(banner);

                banner.OnBannerDataItem.AddListener((value) =>
                {
                    m_iSelectingItemSerial.Value = value.item_serial;
                    UIAssistant.Instance.ShowPage("FieldMenuItemCheck");
                });
            }
        }