SHADE_Y3/Assets/Scripts/UI/SC_MultiImageListControlBut...

41 lines
973 B
C#
Raw Normal View History

2023-02-27 09:55:54 +08:00
using SHADE;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SHADE_Scripting.UI
{
public class MultiImageListControlButton: Script
{
public bool isNext = true;
public GameObject multiImageList;
protected override void awake()
{
UIElement ui = GetComponent<UIElement>();
if (ui != null)
{
ui.OnRelease.RegisterAction(() =>
{
MultiImageList imageList = multiImageList.GetScript<MultiImageList>();
if(imageList != null)
{
if (isNext)
imageList.NextImage();
else
imageList.PrevImage();
}
});
}
}
}
}