c# - MouseEnter()、MouseExit() 和 MouseUp() 仅统一触发一次
问题描述
我正在尝试在我的Unity
项目中创建一个棘手的板条箱。
问题是Unity
只检测variables
一次这些,而玩家应该能够hover
按照他们的意愿打开和关闭板条箱。
代码在其中输出这些值,DebugLog
但是它们仅在第一次执行时才起作用。
提前致谢
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class Detection : MonoBehaviour {
void OnMouseOver()
{
Debug.Log("Enter");
}
void OnMouseExit()
{
Debug.Log("Exit");
}
void OnMouseUp()
{
Debug.Log("Pressed");
}
}
解决方案
推荐阅读
- google-bigquery - 从扁平结构创建具有多个嵌套级别的表
- c# - 一对一变成一对多 Entity Framework 生成数据库优先
- ios - BW Facebook Login 和 FBSDKLoginKit Pod 的区别以及使用哪一个?
- c# - 无法加载文件或程序集“Twilio,版本=5.9.7.0,Culture=neutral,PublicKeyToken=null”。该系统找不到指定的文件。'
- nginx - nginx 数字子域返回冲突的服务器名称
- javascript - 如何在 Vue 中只激活手风琴的一项?
- javascript - 通过 HTML 表单将 Javascript 变量提交给 PHP
- android - 通知是安卓服务
- php - 从不成功的 Google Compute Engine 实例启动中获取错误消息
- c - 如何总结浮点变量内整数除法的分数?