Unity
4、事件监听
·865 字·2 分钟·
loading
·
loading
游戏
Unity
鼠标 # using System.Collections; using System.Collections.Generic; using UnityEngine; public class KeyTest : MonoBehaviour { // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if(Input.GetMouseButtonDown(0)){ Debug.Log("左键按下。。。"); } if(Input.GetMouseButtonDown(2)){ Debug.Log("中键按下。。。"); } if(Input.GetMouseButtonDown(1)){ Debug.Log("右键按下。。。"); } } } 注意:监听需要写在Update中,每一帧都需要监听
2、脚本组件
·6840 字·14 分钟·
loading
·
loading
游戏
Unity
脚本组件 # 脚本是使用 Unity 开发的所有应用程序中必不可少的组成部分。大多数应用程序都需要脚本来响应玩家的输入并安排游戏过程中应发生的事件。除此之外,脚本可用于创建图形效果,控制对象的物理行为,甚至为游戏中的角色实现自定义的 AI 系统。
3、向量和标量
·709 字·2 分钟·
loading
·
loading
游戏
Unity
向量和标量 # 标量:只有大小的量。例如:一个物体距离50米。
1、Unity
·3067 字·7 分钟·
loading
·
loading
游戏
Unity
Unity # Unity是一套具有完善体系与编辑器的跨平台游戏开发工具,也可以称之为游戏引擎。