using System.Collections; using System.Collections.Generic; using UnityEngine; /// /// 跟随轮胎旋转 /// public class RotateWithWheel : MonoBehaviour { public CheLun cheLun; public Vector3 rotateAxis; // Start is called before the first frame update void Start() { cheLun.rotateWithGOs.Add(this); } public void DoRotate(float changeValue) { this.transform.localRotation = Quaternion.Euler(this.transform.localEulerAngles + rotateAxis * changeValue); } }