using GadgetCore.API;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace QuickStack
{
  public class StackButtonScript : MonoBehaviour
  {
    private void OnMouseEnter()
    {
      var render = gameObject.GetComponent<Renderer>();
      render.material = new Material(Shader.Find("Unlit/Transparent"))
      {
        mainTexture = textureStack2
      };
      gameObject.GetComponent<AudioSource>().PlayOneShot((AudioClip)Resources.Load("Au/hover"), Menuu.soundLevel / 10f);
    }

    private void OnMouseExit()
    {
      var render = gameObject.GetComponent<Renderer>();
      render.material = new Material(Shader.Find("Unlit/Transparent"))
      {
        mainTexture = textureStack1
      };
    }

    private void OnEnable()
    {
      var render = gameObject.GetComponent<Renderer>();
      render.material = new Material(Shader.Find("Unlit/Transparent"))
      {
        mainTexture = textureStack1
      };
    }

    private static Texture2D textureStack1 = GadgetCoreAPI.LoadTexture2D("bStack.png");
    private static Texture2D textureStack2 = GadgetCoreAPI.LoadTexture2D("bStack2.png");

  }

}