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

public class ControllerClickScript : MonoBehaviour {

    private SteamVR_TrackedController stc;

	// Use this for initialization
	void Start () {
        stc = gameObject.GetComponent<SteamVR_TrackedController>();
	}
	
	// Update is called once per frame
	void Update () {
        if (stc.triggerPressed)
        {
            RaycastHit hit;

            if (Physics.Raycast(new Ray(gameObject.transform.position, gameObject.transform.forward), out hit))
            {
                print(hit.collider.name);

                if (hit.collider.name.Equals("startButton"))
                {
                    hit.collider.gameObject.GetComponent<MenuStartButton>().LoadGameScene();
                }
            }


        }
	}
}
