202106-23 Unity实现模型点击事件的方法 模型点击事件监听触发模型点击事件的必要条件需要触发模型点击事件的模型身上必须要挂载Collider组件方法一通过OnMouseDown函数监听(只能在PC端有效)1.在Hierarchy面板中右键,点击3DObject->Cube按钮,创建一个Cube模型2.新建一个脚本,命名为“Test.cs”(代码如下)usingSystem.Collections;usingSystem.Collections.Generic;usingUnityEngine;publicclassTest2:MonoBehaviour{privatevoidOnMouseDown()... 继续阅读 >