Unity3的学习之路

香蕉道飞翔の雄鹰丁一朗 香蕉道飞翔の雄鹰丁一朗 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

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);
    }
}

 

...全文

相关推荐

评论 1
收藏 已收藏
分享
返回顶部