FM/Assets/Scripts/Runtime/UI/Other/NotebookLineBar.cs

52 lines
1.3 KiB
C#
Raw Normal View History

2025-06-17 09:31:12 +08:00
using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.UI;
namespace Runtime.UI.Other
{
public class NotebookLineBar: MonoBehaviour
{
public GameObject notebookLine;// material
// public NormalThreedeeProduct notebook;
public Texture[] colorTexs;
public Sprite[] sprites;
public Button buttonPfb;
public Transform holder;
void OnEnable()
{
Init();
}
private void Init()
{
foreach(Transform t in holder)
{
Destroy(t.gameObject);
}
for (int i = 0; i < colorTexs.Length; i++)
{
var spawn = Instantiate(buttonPfb, holder);
spawn.image.sprite = sprites[i];
var tex = colorTexs[i];
int current = i;
// bool isHave = notebook.CheckLayoutQuantity(i);
// if (!isHave)
// {
// spawn.transform.GetChild(0).gameObject.SetActive(true);
// continue;
// }
//
// spawn.onClick.AddListener(() =>
// {
// notebook.ChangeLayout(tex, current);
// });
}
}
}
}