事件函数
如Start、Update、Awake、OnEnable、LateUpdate、OnDisable等……
Time类中静态变量
captureFramerate 通过这个变量来设置帧的速率,通过设置帧的速率可以进行屏幕截图,让屏幕截图在当前帧可以完成。
deltaTime 当前帧运行占用的时间
fixedDeltaTime固定的时间,根据帧数设定而定。
fixedTime
fixedUnscaledDeltaTime
fixedUnscaledTime
frameCount从游戏开始一直到现在一共运行了多少帧。
inFixedTimeStep
maximumDeltaTime
maximumParticleDeltaTime
realtimeSinceStartup 从游戏开始到现在的总时间
smoothDeltaTime
time
timescale 游戏暂停或加速播放
timeSinceLevelLoad场景加载完成之后所占用的时间。
unscaledDeltaTime
unscaledTime游戏从一开始运行到现在的时间
创建游戏物体的三种方法
- 构造方法new GameObject 创建空物体
- GameObject.Instantiate(prefab)(根据prefab或另一个游戏物体克隆)
- GameObject.CreatePrimitive 根据原始图形
给游戏物体通过代码添加组件
AddComponent
禁用和启用一个游戏物体
activeSelf
activeInHierarchy
tag
GameObject、Component、Object的关系
UnityEngine.Object
静态方法
name
Destroy
DestroyImmediate
DontDestroyOnload
FindObjectOfType
FindObjectsOfType
Instantiate
游戏物体间消息的发送和接受
BroadcastMessage
SendMessage
SendMessageUpwards
得到组件的各种方法函数
GetComponent
GetComponentInChildren
GetComponentInParent
GetComponents
GetComponentsInChildren
GetComponentsInParent