Unity学习路程5
8.Update 和 FixedUpdate
如何使用 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);
}
}
9.启用和禁用组件
如何在运行时通过脚本启用和禁用组件。
using UnityEngine;
using System.Collections;
public class EnableComponents : MonoBehaviour
{
private Light myLight;
void Start ()
{
myLight = GetComponent<Light>();
}
void Update ()
{
if(Input.GetKeyUp(KeyCode.Space))
{
myLight.enabled = !myLight.enabled;
}
}
}
...全文
相关推荐
Unity5.0 Shader学习烘焙.pdf
在介绍Unity5.0 Shader学习烘焙之前,我们需要先了解什么是Shader。
Unity5 中文API手册
这个“Unity5中文API.chm”文件是Unity5的中文版官方文档,包含详尽的函数、类和方法介绍,是开发者学习和查阅Unity功能的重要参考。
unity5API中文手册+Unity 5从入门到精通
这个压缩包包含了两部分重要的学习资源:“unity5API中文手册”和“Unity 5从入门到精通”教程。
Unity5.x 完整电子教案PPT
这套PPT教案全面覆盖了Unity5.x的基础和核心知识点,对于想要学习Unity开发的个人或教育机构来说,是一份不可多得的参考资料。
Unity绳子,锁链及弹簧插件 Obi Rope v5.5
总之,Obi Rope v5.5是Unity开发者用于创建具有真实物理效果的绳索、锁链和弹簧的强大工具。


