Time.delta.time是为了缓和void update(){}的东西
next.time是定义的时间
Float next.time=3;
Public某方法(Time.time>next.time){
Next.time=Time.time+1;定义的时间比Time.time打一秒,那么Time.time只能在一秒后
就是大于next.time的情况下,才能进行下一步操作。
}
2 transform.localRotation = new Quaternion(0, 180, 0, 0);//改变子弹方向
transform.Translate(new Vector3(0, 0, -1));
3 创建的模型用要加盒子,而系统自带的cube,spere等都自带有盒子。
4GameObject go= GameObject.Instantiate(cube,transform.position,Quaternion.identity) as GameObject;
解析: 1 所有方法的游戏对象都是GameObject.
2 Instantiate是方法名克隆
3cube,transform.position,Quaternion.identity是3个参数。
4GameObject.Instantiate(cube,transform.position,Quaternion.identity)是创建(克隆)了关于cube的东西。
5 GameObject go= GameObject.Instantiate(cube,transform.position,Quaternion.identity)
是给创建的东西起个名字并且赋值(返回值)
6 as GameObject;这句话语句有错需要强制转换。
5 Unity3D中GameObject Sun与Public GameObject Sun不一样。都可以声明,但是前者默认是私有的。
6水平垂直移动。
float height = 0;
float x = Input.GetAxis("Horizontal") * Time.deltaTime *speed ;
float z = Input.GetAxis("Vertical") * Time.deltaTime * speed;
transform.Translate(new Vector3(x, height, z));
7Vector3.forward是场景中的向前的方向(整个游戏中是不会改变的),
transform.forward是当前对象的向前的方向(gameobject如果旋转,那么向前的方向也会改变的)
用另外两个代替没问题是因为你的模型朝向正好与世界坐标的Z轴正方向一样,首先你要清楚
transform.forward表示的是物体本身朝向朝向,向前向后向左向右), 而Vector3.forward表示世界坐标
的Z轴正朝向(相当于现实中说的东西南北)。
以上是数据库的初步了解,如果你有什么不会的话,可以来狗刨学习网上来看看,如果你想在Unity3D上大展手脚的话,可以来狗刨培训与专家咨询。