using System.Collections; using System.Collections.Generic; using UnityEngine; public class Tuoyuan : MonoBehaviour { public GameObject cubeModel; private float r = 0.25f; private float R = 0.5f; public float angle = 0; // Use this for initialization void Update() { Vector3 center = cubeModel.transform.position; float hudu = (angle / 180) * Mathf.PI; float xx = R * Mathf.Cos(hudu); float yy = r * Mathf.Sin(hudu); cubeModel.transform.position = new Vector3(xx,0 , yy); } }