wuxianshengcong/Assets/Scripts/Handleitem.cs
2024-12-30 10:39:09 +08:00

42 lines
822 B
C#

using System.Collections;
using System.Collections.Generic;
using System.Security.Cryptography;
using UnityEngine;
using UnityEngine.UI;
public class Handleitem : MonoBehaviour
{
public Image Image;
public Sprite NorSprite;
public Sprite SelecrSprite;
// Start is called before the first frame update
void Start()
{
}
void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.name == "Handle")
{
Image.sprite = SelecrSprite;
}
}
void OnTriggerExit2D(Collider2D other)
{
if (other.gameObject.name == "Handle")
{
Image.sprite = NorSprite;
}
}
// Update is called once per frame
void Update()
{
}
}