实现思路:
旋转转盘的z轴,开始以角加速度加速到角速度最大值,结束的时候,以角加速度减速使角速度减少到0,然后转盘z轴旋转的角度就是加上每秒以角速度数值大小,为了使角度不能一直增大,对360度取余再赋值给角度。

注:转盘和箭头可以从windows的画图拉一个圆和几条线做一下,然后用Windows的照片编辑一下 ,使用背景中的删除,就可以把转盘扣出来了,也可以使用我放在下边的
 
 
实现代码:
public class SpinnerControl : MonoBehaviour
{
    public RectTransform imgSpine;
    public float speedMax = 1200;
    public float angularAcceleration = 200;
    float angle = 0;
    float angularVelocity = 0;
    bool isStart = false;
    int[] core = new int[] { 100, 200, 300, 400, 500, 600, 700, 800 };
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            isStart = true;
        }
        if (Input.GetMouseButtonDown(1))
        {
            isStart = false;
        }
        if (isStart)
        {
            angularVelocity = Mathf.Min(speedMax, angularVelocity + angularAcceleration * Time.deltaTime);
            angle += angularVelocity * Time.deltaTime;
            angle %= 360;
            imgSpine.rotation = Quaternion.Euler(0, 0, angle);
        }else if(!isStart && angularVelocity > 0)
        {
            angularVelocity = Mathf.Max(0, angularVelocity - angularAcceleration * Time.deltaTime);
            angle += angularVelocity * Time.deltaTime;
            angle %= 360;
            imgSpine.rotation = Quaternion.Euler(0, 0, angle);
            if(angularVelocity <= 0f)
            {
                Debug.Log(core[Mathf.FloorToInt(angle / 45f)]);
            }
        }
    }
}实现效果:

![Postman[8] 断言](https://i-blog.csdnimg.cn/direct/898b225b17f64134b7e5bde23f070d49.png)



![Postman[4] 环境设置](https://i-blog.csdnimg.cn/direct/5673aa0084294643aeada3bf32aed56b.png)













