36 lines
923 B
C#
Raw Normal View History

2025-05-18 01:04:31 +08:00
// ***********************************************************************
// Assembly : Unity
// Author : Kimch
// Created :
//
// Last Modified By : Kimch
// Last Modified On :
// ***********************************************************************
// <copyright file= "KUIGroupImage" company=""></copyright>
// <summary></summary>
// ***********************************************************************
using UnityEngine;
using UnityEngine.UI;
[RequireComponent(typeof(Image))]
public class KUIGroupImage : MonoBehaviour
{
public Sprite[] imageGroup;
#region Method
public void ShowImage(int index)
{
if (imageGroup != null && imageGroup.Length > 0)
{
if (index >= 0 && index < imageGroup.Length)
{
GetComponent<Image>().overrideSprite = imageGroup[index];
}
}
}
#endregion
}