50
社区成员
发帖
与我相关
我的任务
分享7.Awake 和 Start\n如何使用 Unity 的两个初始化函数 Awake 和 Start。
using UnityEngine;
using System.Collections;
public class AwakeAndStart : MonoBehaviour
{
void Awake ()
{
Debug.Log("Awake called.");
}
void Start ()
{
Debug.Log("Start called.");
}
}
8.Update 和 FixedUpdate\n如何使用 Update 和 FixedUpdate 函数实现每帧的更改,以及它们之间的区别。
using UnityEngine;
using System.Collections;
public class UpdateAndFixedUpdate : MonoBehaviour
{
void FixedUpdate ()
{
Debug.Log("FixedUpdate time :" + Time.deltaTime);
}
void Update ()
{
Debug.Log("Update time :" + Time.deltaTime);
}
}