27 lines
658 B
C#
27 lines
658 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class ShadowSlot : MonoBehaviour
|
|
{
|
|
public int slotID;
|
|
private Image myImage;
|
|
public bool isOccupied = false;
|
|
|
|
public void Setup(Sprite sp, int id)
|
|
{
|
|
myImage = GetComponent<Image>();
|
|
myImage.sprite = sp;
|
|
slotID = id;
|
|
isOccupied = false;
|
|
|
|
// Jadikan hitam gelap untuk bayangan
|
|
myImage.color = new Color(0.1f, 0.1f, 0.1f, 0.7f);
|
|
}
|
|
|
|
public void CompleteSlot()
|
|
{
|
|
isOccupied = true;
|
|
// Munculkan warna asli gambar
|
|
if (myImage != null) myImage.color = new Color(1f, 1f, 1f, 1f);
|
|
}
|
|
} |