* Title:””* Function:* - 太阳自转* - 地球自转、公转* - 月球自转、公转* Used By:Main Camera* Author:V.* Date:.12.* Version:1.0* Description(Record):*************************/using UnityEngine;using System.Collections;public class SunEarthMoon : MonoBehaviour {public Transform TrSun;//定义太阳的transform//public GameObject GoSun;public Transform TrEarth;//定义地球的transformpublic Transform TrMoon;//定义月球的transform//public GameObject GO;//public Camera MyCamera;public float FlRotaSpeedSelf;//自转速度public float FlRotaSpeedCommEarth;//地球公转速度public float FlRotaSpeedCommMoon;//月球公转速度void Update () {//太阳自转//this.gameObject.transform.Rotate ();//transform.Rotate();TrSun.Rotate (Vector3.up * FlRotaSpeedSelf);//GoSun.transform.Rotate ();//地球自转TrEarth.Rotate (Vector3.up * FlRotaSpeedSelf);//地球公转TrEarth.RotateAround(TrSun.position, Vector3.up, FlRotaSpeedCommEarth);//月球自转TrMoon.Rotate(Vector3.up * FlRotaSpeedSelf);//月球公转TrMoon.RotateAround(TrEarth.position, Vector3.up, FlRotaSpeedCommMoon);}//end_Update}
素材连接地址 : 链接:/s/1dFnGWd7 密码:05t1