using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ZoomedClock : MonoBehaviour
{
    public ZoomedClock Instance;
    
    public GameObject clockHand;
    public AlarmClock alarmClock;
    public Transform handAnchor;

    public static readonly double TWELVE_HOURS_IN_MS = TimeSpan.FromHours(12).TotalMilliseconds;

    private void Awake()
    {
        Instance = this;
    }

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        double theta = 360 * alarmClock.timeUntilAlarm.TotalMilliseconds / TWELVE_HOURS_IN_MS;
        
        clockHand.transform.localRotation = Quaternion.Euler(0, 0, -(float)theta);
    }
}
