Unity3d 常用功能总结

1. 运动相关

获得刚体运动速度的方法  rigidbody.velocity.magnitude

设置重心可以防止侧翻    rigidbody.centerOfMass = gameobject.transform.localPosition;



2.坐标相关

将自身坐标系转换为世界坐标系 TransformDirection



3. iPhone相关

导出到iPhone后出现编译错误的情况,按照下面的方法修改后解决。

http://answers.unity3d.com/questions/167290/xcode-fails-to-build-a-very-simple-scene-201-error.html

  1. In Unity, adjust Player Settings in "SDK Version" to iOS Simulator latest
  2. Build project - this generates the XCODE project.
  3. Open project in XCODE, make sure you choose the scheme: "Unity-iPhone-simulator".
  4. Choose PRODUCT-CLEAN (may not be required, but gets rid of any eventual leftover cache from failed builds)
  5. Build and Run... and hopefully get a warm fuzzy feeling inside as unity logos appears on simulator :]

你可能感兴趣的:(Unity3d 常用功能总结)