-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameOverMenu.cs
41 lines (35 loc) · 1.25 KB
/
GameOverMenu.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class GameOverMenu: MonoBehaviour {
public static bool Beast; // 0 = Felis, 1 = Canis
public FelisEtCanisController felisEtCanisScript;
public Image felisSelected;
public Image canisSelected;
public int score;
public void LoadLevel(string levelName) {
GameObject FelisEtCanisObject = GameObject.Find("FelisEtCanis");
// FelisEtCanisController felisEtCanisScript = FelisEtCanisObject.GetComponent<FelisEtCanisController>();
FelisEtCanisController.pickBeast(Beast);
SceneManager.LoadScene (levelName);
}
public void ChooseBeast(bool beast) {
Beast = beast;
if (beast) { // canis
felisSelected.enabled = false;
canisSelected.enabled = true;
} else { // felis
felisSelected.enabled = true;
canisSelected.enabled = false;
}
}
void OnEnable(){
GameObject FelisEtCanisObject = GameObject.Find("FelisEtCanis");
FelisEtCanisController felisEtCanisScript = FelisEtCanisObject.GetComponent<FelisEtCanisController>();
GameObject scoreObject = GameObject.Find("ScoreObject");
scoreObject.GetComponent<Text> ().text = "ASDSFASF";
//scoreObject.GetComponent<Text> ().text = score.ToString();
}
}