예제 #1
0
    public void Open(TotemData td)
    {
        if (td == null)
        {
            return;
        }
        playExp             = 0;
        plusLevel           = 0;
        composeItem         = td;
        playItem_img.sprite = ResourceMgr.Instance.LoadSprite(td.ItemData.icon);
        ExpValue();
        name_txt.text = td.ItemData.name;
        SetAttrActive(false);

        st = tip_obj.GetComponent <ScaleTween>();
        st.AddOnFinished(delegate() { tip_obj.SetActive(false); });
        EventListener.Get(tip_btn.gameObject).OnClick = e =>
        {
            tip_obj.SetActive(true);
            st.ResetToBeginning();
            st.PlayForward();
        };
        EventListener.Get(close_btn.gameObject).OnClick = e =>
        {
            UIFace.GetSingleton().Close(UIID.CompostDivination);
        };
        SetPlayView();
        InitItem();
    }
예제 #2
0
    void Start()
    {
        for (int i = 0; i < mt.Length; ++i)
        {
            DivinationTree dt = mt[i];
            dt.progress = progress;
            dt.SetView(i);
            ScaleTween st = dt.get_btn.GetComponent <ScaleTween>();

            EventListener.Get(dt.get_btn.gameObject).OnClick = e =>
            {
                if (!dt.get_btn.interactable)
                {
                    return;
                }
                int pro = dt.RandomTree();
                Instantiate("totem" + ++id);
                st.ResetToBeginning();
                st.PlayForward();
                SetProgress(pro);
            };
        }
        st = tip_obj.GetComponent <ScaleTween>();
        st.AddOnFinished(delegate() { tip_obj.SetActive(false); });
        EventListener.Get(tip_btn.gameObject).OnClick = e =>
        {
            tip_obj.SetActive(true);
            st.ResetToBeginning();
            st.PlayForward();
        };

        EventListener.Get(divination20_btn.gameObject).OnClick = e =>
        {
            ProcessCtrl.Instance.GoCoroutine("OneKeyinstantiate", OneKeyinstantiate());
        };
    }