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

public class ZoomedHeater : MonoBehaviour
{
    private bool isOn;
    public GameObject on;
    public GameObject off;
    public AudioClip switchOn;
    public AudioClip switchOff;
    
    // Start is called before the first frame update
    void Start()
    {
        Thermometer.contributions.Add(gameObject, 0f);
    }

    // Update is called once per frame
    void Update()
    {
        on.SetActive(isOn);
        off.SetActive(!isOn);
    }

    private void OnMouseDown()
    {
        if (isOn)
        {
            isOn = false;
            AudioManager.playClip(switchOn);
            Thermometer.contributions[gameObject] = 0f;
        }
        else
        {
            isOn = true;
            AudioManager.playClip(switchOff);
            Thermometer.contributions[gameObject] = .06f;
        }
    }
}
