Files
old-profesoratom/Assets/Scripts/EntrySceneScript.cs
2017-05-23 22:55:39 +03:00

51 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class EntrySceneScript : MonoBehaviour {
// Use this for initialization
void Start () {
Debug.Log("Started");
}
// Update is called once per frame
void Update () {
// Select answers event handler
if (Input.GetMouseButtonDown(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit, 100))
{
if(hit.transform.gameObject.name == "FirstGame")
{
Debug.Log("Load first game");
SceneManager.LoadScene("Quiz4Scene");
}
else if (hit.transform.gameObject.name == "SecondGame")
{
Debug.Log("Load second game");
SceneManager.LoadScene("Quiz2Scene");
}
}
}
}
public void LoadFirstGame()
{
}
public void LoadSecondGame() {
}
}