using System.Collections;
public class _01event : MonoBehaviour {
// Use this for initialization
//熟悉下列事件在什么情况下运行
void Start () {
Debug.Log("Start");
}
//最先执行先于Start,和Start都是自动执行
void Awake()
{
Debug.Log("Awake");
}
//该程序和uppdate一样 ,只是不受电脑性能影响
void FixedUpdate()
{
Debug.Log("FixedUpdate");
}
// Update is called once per frame
void Update () {
Debug.Log("Update");
}
//游戏暂停是执行
void OnApplicationPause()
{
Debug.Log("OnApplicationPause");
}
//程序或对象禁用时执行
void OnDisable()
{
Debug.Log("OnDisable");
}
//退出时使用
void OnApplicationQuit()
{
Debug.Log("OnApplicationQuit");
}
//
void Reset()
{
Debug.Log("Reset");
}
//程序或对象禁用时执行
void OnDestroy()
{
Debug.Log("OnDestroy");
}
}
using UnityEngine;
using System.Collections;
public class API02Time : MonoBehaviour {
// Use this for initialization
void Start () {
Debug.Log("Time.deltaTime:" + Time.deltaTime);
Debug.Log("Time.fixedDeltaTime:" + Time.fixedDeltaTime);
Debug.Log("Time.fixedTime:" + Time.fixedTime);
Debug.Log("Time.frameCount" + Time.frameCount);
Debug.Log("Time.realtimeSinceStartup" + Time.realtimeSinceStartup);
Debug.Log("Time.smoothDeltaTime" + Time.smoothDeltaTime);
Debug.Log("Time.time" + Time.time);
Debug.Log("Time.timeScale" + Time.timeScale);
Debug.Log("Time.timeSinceLevelLoad)" + Time.timeSinceLevelLoad);
Debug.Log("Time.unscaledTime" + Time.unscaledTime);
}
// Update is called once per frame
void Update () {
//Debug.Log("Time.deltaTime:" + Time.deltaTime);
//Debug.Log("Time.fixedDeltaTime:" + Time.fixedDeltaTime);
//Debug.Log("Time.fixedTime:" + Time.fixedTime);
//Debug.Log("Time.frameCount" + Time.frameCount);
//Debug.Log("Time.realtimeSinceStartup" + Time.realtimeSinceStartup);
//Debug.Log("Time.smoothDeltaTime" + Time.smoothDeltaTime);
//Debug.Log("Time.time" + Time.time);
//Debug.Log("Time.timeScale" + Time.timeScale);
//Debug.Log("Time.timeSinceLevelLoad)" + Time.timeSinceLevelLoad);
//Debug.Log("Time.unscaledTime" + Time.unscaledTime);
}
}