Beispiel #1
0
    protected virtual void OnClickEnhanceItem(MyNGUIEnhanceItem _nItem = null, MyUGUIEnhanceItem _Item = null)
    {
        EnhanceScrollView ESV = _nItem.GetComponentInParent <EnhanceScrollView>();

        ESV.setFishActivefalse();
        ESV.SetHorizontalTargetItemIndex(this);
    }
Beispiel #2
0
    void Update()
    {
        if (isPlay && Time.time > this.endTime)
        {
            mEnhancelScrollView.scrollViewItems = new List <EnhanceItem>();
            for (int i = 0; i < ItemDataList.Count; i++)
            {
                Page_4_3_ItemData data = ItemDataList[i];

                GameObject        go     = GameObject.Instantiate(prefab.gameObject, prefab.transform.parent).gameObject;
                MyUGUIEnhanceItem ueItem = go.GetComponent <MyUGUIEnhanceItem>();
                go.gameObject.SetActive(true);
                mEnhancelScrollView.scrollViewItems.Add(ueItem);
                string imagePath = "";
                if (data.imgs != null && data.imgs.Length > 0)
                {
                    imagePath = data.imgs[0];
                }
                string content = data.content;

                Image image = go.transform.Find("Img_1").GetComponent <Image>();
                Text  text  = go.transform.Find("txt_1").GetComponent <Text>();

                GameTools.Instance.LoadImage(image, imagePath, 4, 4);
                text.text = content;

                GameTools.AddClickEvent(image.gameObject, () =>
                {
                    ClickItem(data);
                });
            }

            isPlay = false;
            mEnhancelScrollView.gameObject.SetActive(true);
        }
    }
Beispiel #3
0
 protected override void OnClickEnhanceItem(MyNGUIEnhanceItem _nItem = null, MyUGUIEnhanceItem _Item = null)
 {
     // item was clicked
     base.OnClickEnhanceItem(this);
 }