remove coins txt
This commit is contained in:
parent
671c2d35e9
commit
beba661515
@ -34,12 +34,13 @@ public class GameController : MonoBehaviour
|
|||||||
instance = this;
|
instance = this;
|
||||||
DontDestroyOnLoad(this.gameObject);
|
DontDestroyOnLoad(this.gameObject);
|
||||||
SceneManager.activeSceneChanged += ChangedScene;
|
SceneManager.activeSceneChanged += ChangedScene;
|
||||||
coinText.text = "0";
|
|
||||||
if(!SceneManager.GetActiveScene().name.Equals(mainScene) && !SceneManager.GetActiveScene().name.Equals(endScene)){
|
|
||||||
coinText.gameObject.SetActive(false);
|
coinText.gameObject.SetActive(false);
|
||||||
}else{
|
// coinText.text = "0";
|
||||||
coinText.gameObject.SetActive(true);
|
// if(!SceneManager.GetActiveScene().name.Equals(mainScene) && !SceneManager.GetActiveScene().name.Equals(endScene)){
|
||||||
}
|
// coinText.gameObject.SetActive(false);
|
||||||
|
// }else{
|
||||||
|
// coinText.gameObject.SetActive(true);
|
||||||
|
// }
|
||||||
audioSource = GetComponent<AudioSource>();
|
audioSource = GetComponent<AudioSource>();
|
||||||
}else{
|
}else{
|
||||||
Destroy(this.gameObject);
|
Destroy(this.gameObject);
|
||||||
@ -50,7 +51,7 @@ public class GameController : MonoBehaviour
|
|||||||
public void AddCoins(int amount){
|
public void AddCoins(int amount){
|
||||||
//This should not be like this. Collectible should call the player that hit it and add to their amount
|
//This should not be like this. Collectible should call the player that hit it and add to their amount
|
||||||
coinAmount += amount;
|
coinAmount += amount;
|
||||||
coinText.text = coinAmount.ToString();
|
//coinText.text = coinAmount.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -79,11 +80,11 @@ public class GameController : MonoBehaviour
|
|||||||
|
|
||||||
private void ChangedScene(Scene curr, Scene next){
|
private void ChangedScene(Scene curr, Scene next){
|
||||||
fadeCoroutine = StartCoroutine(FadeToBlack(string.Empty, false, fadeSpeed));
|
fadeCoroutine = StartCoroutine(FadeToBlack(string.Empty, false, fadeSpeed));
|
||||||
if(!next.name.Equals(mainScene) && !next.name.Equals(endScene)){
|
// if(!next.name.Equals(mainScene) && !next.name.Equals(endScene)){
|
||||||
coinText.gameObject.SetActive(false);
|
// coinText.gameObject.SetActive(false);
|
||||||
}else{
|
// }else{
|
||||||
coinText.gameObject.SetActive(true);
|
// coinText.gameObject.SetActive(true);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerator FadeToBlack(string sceneToLoad,bool fadeToBlack = true, float fadeSpeed = 2.5f){
|
public IEnumerator FadeToBlack(string sceneToLoad,bool fadeToBlack = true, float fadeSpeed = 2.5f){
|
||||||
|
|||||||
@ -8,12 +8,6 @@ EditorBuildSettings:
|
|||||||
- enabled: 1
|
- enabled: 1
|
||||||
path: Assets/Scenes/MainMenu.unity
|
path: Assets/Scenes/MainMenu.unity
|
||||||
guid: af63aef6e17277b44ade3df35992db53
|
guid: af63aef6e17277b44ade3df35992db53
|
||||||
- enabled: 0
|
|
||||||
path: Assets/Scenes/Dev.unity
|
|
||||||
guid: 739ca6d2c9f3b5b4a8885b94cf11f074
|
|
||||||
- enabled: 0
|
|
||||||
path: Assets/Scenes/GameLogic.unity
|
|
||||||
guid: 6c735b8f44735c84789efdc5bc7c8d2d
|
|
||||||
- enabled: 1
|
- enabled: 1
|
||||||
path: Assets/Scenes/LevelDesign.unity
|
path: Assets/Scenes/LevelDesign.unity
|
||||||
guid: 4b213b8915c09ca49873cfadc143c61b
|
guid: 4b213b8915c09ca49873cfadc143c61b
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user