Unity 4 到 5 发生的重大改变
Rigidbody组件的获取
GetComponent<Rigidbody>() 要在Start里获取
API 弃用
Application.LoadlLevel("name")
改成:
SceneManager.loadScene("name")
黑暗之光 UICamera.hoverObject==null UIRoot NGUI UGUI
Unity 4 到 5 发生的重大改变
Rigidbody组件的获取
GetComponent<Rigidbody>() 要在Start里获取
API 弃用
Application.LoadlLevel("name")
改成:
SceneManager.loadScene("name")
黑暗之光 UICamera.hoverObject==null UIRoot NGUI UGUI
unity4-unity5
组件弃用解决方法:
例:Rigidbody可用 GetComeponent<Rigidbody>( )解决。
Api弃用:
例:Application.LoadLevel("name")
可用 SceneManager.LoadScence("name")
替代。
如果无法
查找某Api的命名空间:unity>Help>ScriptReference>Serch
4.5到5.0版本,部分组件使用被启用。
rigidbody
renderer
light
解决方法
start里面先获得
GetComponent<Rigidbody>()
private Rigidbody rgd;
void Start(){
rgd=GetComponent<Rigidbody>();
}
rgd.AddForce