2019独角兽企业重金招聘Python工程师标准>>>
实现了围绕圆心旋转功能
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class Roation : MonoBehaviour {public float range = 10;void Update () {float x = Mathf.Sin(Mathf.PI * 2 * Time.time * 0.1f) * range;float z = Mathf.Cos(Mathf.PI * 2 * Time.time * 0.1f) * range;Vector3 curPosition = Vector3.zero;curPosition.x += x;curPosition.z += z;this.transform.position = curPosition;}
}