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

public class SelectionButton : MonoBehaviour {
    public SpriteRenderer methodRenderer;
    public Sprite active;
    public Sprite deactive;
    public SpriteRenderer Arrow;

    Animator anim;

    public int selectedMethod;
    public string targetScene;

	// Use this for initialization
	void Start () {
        anim = GetComponent<Animator>();
        methodRenderer.sprite = deactive;
        Arrow.enabled = (false);
		
	}
	
	// Update is called once per frame
	void Update () {
	}


    private void OnMouseEnter()
    {
        Arrow.enabled = (true);
        methodRenderer.sprite = active;
        anim.SetBool("hover", true);
       
    }

    private void OnMouseExit()
    {
        anim.SetBool("hover", false);
        Arrow.enabled = (false);
        methodRenderer.sprite = deactive;

    }

    private void OnMouseUp()
    {
        print("selected method " + selectedMethod);
        StaticStore.SelectedMethod = selectedMethod;
        SceneManager.LoadScene(targetScene);
    }
}
