You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.2 KiB
59 lines
1.2 KiB
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace DisComputer
|
|
{
|
|
/*
|
|
* @func 零件列表信息
|
|
* @author lz
|
|
* @date 2020/06/30
|
|
*/
|
|
public class SpareScrollItem : MonoBehaviour
|
|
{
|
|
|
|
public RawImage sp_Rimg;
|
|
|
|
//零件信息
|
|
public SpareInfo spareInfo;
|
|
|
|
private Grid grid;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
Button button = this.GetComponent<Button>();
|
|
button.onClick.AddListener(OnClickSpare);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 注册格子
|
|
/// </summary>
|
|
/// <param name="grid"></param>
|
|
public void RegistGrid(Grid grid)
|
|
{
|
|
this.grid = grid;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 设置滚动列表
|
|
/// </summary>
|
|
public void SetScrollItem()
|
|
{
|
|
sp_Rimg.texture = spareInfo.texture;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 点击零件
|
|
/// </summary>
|
|
void OnClickSpare()
|
|
{
|
|
grid.SetCurSpareInfo(spareInfo);
|
|
MessageContainer.SendMessage(spareInfo.simpleInfoStr, this, MsgName.TipViewSpareInfo);
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|