首页 > 代码库 > Unity 制作Load等待小图标

Unity 制作Load等待小图标

 

技术分享

 

直接上代码:

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

Unity 制作Load等待小图标