新冷却液
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace AibisDream.Framework
|
||||
{
|
||||
public class SpriteButtonKit : IMonoKit
|
||||
{
|
||||
private readonly Camera _camera = Camera.main;
|
||||
private GameObject _curButton;
|
||||
|
||||
public void OnUpdate()
|
||||
{
|
||||
// 发射射线进行检测
|
||||
Ray ray = _camera.ScreenPointToRay(Input.mousePosition);
|
||||
RaycastHit2D hit = Physics2D.Raycast(ray.origin, ray.direction);
|
||||
|
||||
// 射线没有碰撞到东西
|
||||
if (!hit.collider)
|
||||
{
|
||||
_curButton = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public interface ISpriteButton
|
||||
{
|
||||
public void OnMouseEnter();
|
||||
public void OnMouseExit();
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user