using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class API01EvenetFunction : MonoBehaviour {
/// <summary>
/// 初始化
/// </summary>
void Awake()
{
Debug.Log("Awake"+"初始化");
}
void Start () {
Debug.Log("Start"+"开始");
}
void OnEnable()
{
Debug.Log("OnEnable"+"启用");
}
void OnDisable()
{
Debug.Log("Disable"+"禁用");
}
/// <summary>
/// 常用App的调用
/// </summary>
void OnApplicationQuit()
{
Debug.Log("退出" + "OnApplicaitionQuit");
}
void OnApplicationPause(bool pause)
{
Debug.Log("暂停" + "OnApplicaitionPause");
}
/// <summary>
/// 常用方法
/// </summary>
void Update () {
Debug.Log("Update"+"每帧运行");
}
void FixedUpdate()
{
Debug.Log("FixedUpdate"+"每帧固定运行");
}
void LateUpdate()
{
Debug.Log("LateUpdate"+"每帧固定运行,晚执行于Update");
}
void Reset()
{
Debug.Log("被重置" + "Reset");
}
/// <summary>
/// /力的作用
/// </summary>
/// <param name="other"></param>
void OnTriggerEnter(Collider other)
{
Debug.Log("触发检测-进入" + "OnTriggerEnter");
}
void OnTriggerExit(Collider other)
{
Debug.Log("触发检测-离开" + "OnTriggerExit");
}
void OnTriggerStay(Collider other)
{
Debug.Log("触发检测-触发(每帧检测)" + "OnTriggerStay");
}
void OnCollisionEnter(Collision collision)
{
Debug.Log("当碰撞器/刚体-开始碰撞/进入" + "OnCollisionEnter");
}
void OnCollisionExit(Collision collision)
{
Debug.Log("当碰撞器/刚体-结束碰撞/离开" + "OnCollisionExit");
}
void OnCollisionStay(Collision collision)
{
Debug.Log("当碰撞器/刚体检测-触发(每帧检测)" + "OnCollisionStay");
}
}
Unity 常用API01EvenetFunction:各类常用方法的使用
猜你喜欢
转载自blog.csdn.net/flower_stealth/article/details/84497216
今日推荐
周排行