少年修仙传客户端代码仓库
xingchen Qiu
2019-04-10 b45f84d1a84cb768d0b136fe37ad18364d74af1f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using UnityEngine;
using UnityEngine.UI;
 
 
namespace Snxxz.UI
{
    public class AddItemGetPathBtn : MonoBehaviour
    {
        [SerializeField] Button addBtn;
        [Header("跳转界面ID 0不跳转")]
        [SerializeField] int jumpId = 0;
        [Header("获取途径物品Id,0不打开")]
        [SerializeField] int itemId = 0;
 
        GetItemPathModel pathModel { get { return ModelCenter.Instance.GetModel<GetItemPathModel>(); } }
        private void Awake()
        {
            addBtn.AddListener(ClickAddBtn);
        }
 
        private void ClickAddBtn()
        {
            if((JumpUIType)jumpId != JumpUIType.None)
            {
                WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)jumpId);
            }
            else
            {
                ItemConfig itemConfig = ItemConfig.Get(itemId);
                if (itemConfig != null)
                {
                    if (itemConfig.GetWay != null && itemConfig.GetWay.Length > 0)
                    {
                        pathModel.SetChinItemModel(itemId);
                    }
                }
            }
        }
    }
}