游戏制作二

来源:互联网 发布:整治网络传销可丽金 编辑:程序博客网 时间:2024/05/16 14:48

其他相关

材质球制作;
avatar制作;
physic material制作;

while (ii<ct) {tr = transform.GetChild(ii);tr.SetParent(null);//就是这一句,必须有。不然逻辑上不会立即将父级的子级个数更新,导致逻辑错误!Destroy(tr.gameObject);//GameLog.log("删除:"+ii+" ct:"+ct);ii++;}



不同于之前之处

1.假如游戏Menu菜单,点击帮助,关于等按钮会跳转其他界面,之前方案是,把所有脚本挂在再Camera,激活和关闭某些脚本,进行脚本切换,达到切换界面效果;
现在做法是,每个界面切换是一个Scene,不用脚本管理,但是Scene太多;
2.帮助界面,之前是,图片切换,按钮切换,进行渲染,现在是,每个摄像机对应一个plane,点击按钮,切换摄像机,达到绘制不同界面(相机挂脚本,脚本也会切换)





Rigidbody刚体

AddForce
Adds a force to the rigidbody. As a result the rigidbody will start moving.
添加一个力到刚体。作为结果刚体将开始移动。




Camera摄像机

main
The first enabled camera tagged "MainCamera" (Read Only).
第一个启用的被标记为“MainCanmera”的相机(只读)。
WorldToScreenPoint
Transforms position from world space into screen space.
从世界空间到屏幕空间变换位置。
ScreenToWorldPoint
Transforms position from screen space into world space.
从屏幕空间到世界空间的变化位置。
void OnMouseDown() {screenPosition=Camera.main.WorldToScreenPoint (transform.position);position=transform .position -Camera.main.ScreenToWorldPoint (new Vector3 (Input.mousePosition.x,Input.mousePosition.y ,screenPosition.z));StartCoroutine (ChangePosition());}






Collider 碰撞器 

transform
The Transform attached to this GameObject (null if there is none attached).
Transform附加到GameObject(游戏物体)(如无附加则为空)。







Transform 变换 

name
The name of the object. //物体的名字









补充API(前文章)








0 0
原创粉丝点击