事件函数
如Start、Update、Awake、OnEnable、LateUpdate、OnDisable等……

Time类中静态变量
captureFramerate 通过这个变量来设置帧的速率,通过设置帧的速率可以进行屏幕截图,让屏幕截图在当前帧可以完成。
deltaTime 当前帧运行占用的时间
fixedDeltaTime固定的时间,根据帧数设定而定。
fixedTime
fixedUnscaledDeltaTime
fixedUnscaledTime
frameCount从游戏开始一直到现在一共运行了多少帧。
inFixedTimeStep
maximumDeltaTime
maximumParticleDeltaTime
realtimeSinceStartup 从游戏开始到现在的总时间
smoothDeltaTime
time
timescale 游戏暂停或加速播放
timeSinceLevelLoad场景加载完成之后所占用的时间。
unscaledDeltaTime
unscaledTime游戏从一开始运行到现在的时间

创建游戏物体的三种方法

  1. 构造方法new GameObject 创建空物体
  2. GameObject.Instantiate(prefab)(根据prefab或另一个游戏物体克隆)
  3. GameObject.CreatePrimitive 根据原始图形

给游戏物体通过代码添加组件
AddComponent

禁用和启用一个游戏物体
activeSelf
activeInHierarchy
tag

GameObject、Component、Object的关系
Unity API学习笔记(一)

UnityEngine.Object

静态方法
name
Destroy
DestroyImmediate
DontDestroyOnload
FindObjectOfType
FindObjectsOfType
Instantiate

游戏物体间消息的发送和接受
BroadcastMessage
SendMessage
SendMessageUpwards

得到组件的各种方法函数
GetComponent
GetComponentInChildren
GetComponentInParent
GetComponents
GetComponentsInChildren
GetComponentsInParent

相关文章:

  • 2021-12-21
  • 2022-02-20
  • 2022-12-23
  • 2021-06-10
  • 2022-01-09
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-09
  • 2021-04-27
  • 2021-07-04
  • 2021-06-19
  • 2021-11-23
  • 2021-12-21
  • 2022-12-23
相关资源
相似解决方案