UI fixed; Entry room integration
This commit is contained in:
@@ -6,30 +6,45 @@ using UnityEngine.SceneManagement;
|
||||
|
||||
public class EntrySceneScript : MonoBehaviour {
|
||||
|
||||
public Button firstGameButton;
|
||||
|
||||
public Button secondGameButton;
|
||||
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
Debug.Log("Started");
|
||||
firstGameButton.GetComponent<Button>().onClick.AddListener(LoadFirstGame);
|
||||
secondGameButton.GetComponent<Button>().onClick.AddListener(LoadSecondGame);
|
||||
}
|
||||
|
||||
// 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()
|
||||
{
|
||||
Debug.Log("Load first game");
|
||||
SceneManager.LoadScene("Quiz4Scene");
|
||||
|
||||
}
|
||||
|
||||
public void LoadSecondGame() {
|
||||
Debug.Log("Load second game");
|
||||
SceneManager.LoadScene("Quiz2Scene");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ public class Quiz2Controller : MonoBehaviour {
|
||||
if (scoreValue < 0)
|
||||
scoreValue = 0;
|
||||
}
|
||||
scoreText.text = scoreValue.ToString();
|
||||
scoreText.text = scoreValue.ToString("D3");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -303,7 +303,7 @@ public class Quiz4Controller : MonoBehaviour {
|
||||
if (scoreValue < 0)
|
||||
scoreValue = 0;
|
||||
}
|
||||
scoreText.text = scoreValue.ToString();
|
||||
scoreText.text = scoreValue.ToString("D3");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user