用户登录
用户注册

分享至

unity log

  • 作者: 烟花寂寞丶
  • 来源: 51数据库
  • 2020-10-05
Print是MonoBehaviour的一个成员。Debug则是一个密闭的类。
所以在使用的范围上,Print必须要继承MonoBehaviour类,而Debug不用。
通过反编译,我们可以看到print方法具体如下:
public static void print(object message)
{
Debug.Log(message);
}
这说明print方法还是通过debug.log实现的,所以print和debug.log在实质上是没区别的,print就是debug.log的一个简单封装。



  是有输出的,只是输出大量为空。
1、input.inputstring的值很快就会清空。官方描述:returns the keyboard input entered this frame. (read only)即,返回某一帧的键盘输入,下一帧就会被清空
2、使用input.getkeydown时,系统是有一定的延迟时间。官方描述:returns true during the frame the user starts pressing down the key identified by name.即该函数用于判定是否一直按着某个键
所以可以改用input.getkey函数。

另外由于1帧可以检测到多个input.getkey,所以会在按下a键时输出一次,之后会输出若干次空值
软件
前端设计
程序设计
Java相关