RouletteObject.csを作る。
using UnityEngine; public class RouletteObject : MonoBehaviour { public float RotateSpeed; float RotateSpeed_; int flg = 0; void Update() { if (Input.GetMouseButtonDown(0)) { RotateSpeed_ = RotateSpeed; flg = (flg == 1) ? 0 : 1; } transform.Rotate(0, 0, RotateSpeed_); if (flg == 0) RotateSpeed_ *= 0.98f; } }
上記のような スクリプトを作ります。
補足
①マウスを左クリックで回転開始。
②もう一度左クリックで減速開始。
