using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ClockHandController : MonoBehaviour
{
    [SerializeField] GameObject ClockHand;

    Tween ClockTween;

    void Start()
    {
        
    }

    void Update()
    {
        
    }

    public Tween StartClock()
    {
        ClockHand.transform.localRotation = Quaternion.identity;
        ClockTween = DOTween.To(() => ClockHand.transform.localEulerAngles, x => ClockHand.transform.localEulerAngles = x, new Vector3(0, 0, -360), 10f)
            .SetEase(Ease.Linear);

        return ClockTween;
    }

    public void ResetClock()
    {
        ClockHand.transform.localRotation = Quaternion.identity;
        ClockTween.Kill();
    }
}
