Esempio n. 1
0
        private void ShowDesc(UISkillItem skill)
        {
            _currentItem = skill;
            _skillDesc.SetActive(true);
            _skillDesc.transform.localPosition = new Vector3(300f, _skillDesc.transform.localPosition.y,
                                                             _skillDesc.transform.localPosition.z);
            _skillDesc.GetComponent <RectTransform>().DOAnchorPos(new Vector2(-290f, -44f), 0.25f, true);

            RefreshDesc(skill);
        }
Esempio n. 2
0
        private void CreateSkillItem(UDSkill.Skill skill)
        {
            GameObject go = GameObject.Instantiate(_skillItem) as GameObject;

            go.transform.SetParent(_skillItem.transform.parent);
            go.transform.localScale = Vector3.one;
            go.SetActive(true);

            UISkillItem item = go.AddComponent <UISkillItem>();

            item.Refresh(skill);
            _skillItems.Add(item);

            go.AddComponent <Button>().onClick.AddListener(OnClickSkillItem);
        }
Esempio n. 3
0
 private void RefreshDesc(UISkillItem skill)
 {
     _skillDesc.transform.Find("content").GetComponent <Text>().text
         = skill.data.Desc + "\n名称:" + skill.data.Name + "\n等级:" + skill.data.Level;
 }
Esempio n. 4
0
        private void OnClickSkillItem()
        {
            UISkillItem item = EventSystem.current.currentSelectedGameObject.GetComponent <UISkillItem>();

            ShowDesc(item);
        }