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);
|
}
|
}
|
}
|
}
|
}
|
}
|