视频教学来源:www.51cto.com
新建3个Sphere,分别名为sun,earth,moon,
新建2个C#script,分别名为Rotatescr,RotateAroundscr
Rotatescr在update()中只写一句
this.transform.Rotate (Vector3.up*1F,Space.World);
RotateAroundscr也在upate()中写一句
this.transform.RotateAround (RotateAroundObj.position,Vector3.up,1F);
public Transform RotateAroundObj是被环绕的对象。
分别拖拽Rotatescr给3个Sphere,
拖拽RotateAroundscr给earth和moon
最后把sun拖拽给earth的RotateAroundscr中的RotateAroundObj,把earth拖拽给moon的RotateAroundscr中的RotateAroundObj。
目前在初学阶段,只知道怎么做,至于为什么,以后加深理解。