标签:
using UnityEngine; using System.Collections; public class LoadRotate : MonoBehaviour { public float speed = 8f; public RotateAxis direction = RotateAxis.z; // Update is called once per frame void Update() { if (RotateAxis.x == direction) { this.transform.Rotate(Vector3.right * speed); } else if (RotateAxis.y == direction) { this.transform.Rotate(Vector3.up * speed); } else { this.transform.Rotate(Vector3.forward * speed); } } public enum RotateAxis { x, y, z } }
源代码: http://yunpan.cn/cyKqLtRdfpAwN 提取码 5aa7
标签:
原文地址:http://www.cnblogs.com/plateFace/p/4194509.html