Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

How to change level after my game over screen appears? C#

$
0
0
Hello, I am creating game with use of a master script. Inside my Game Over Script I would like for the first level to be loaded Blank number of seconds after the Game Over Panel is set to true. When I try this my "void TurnOnGameOverPanel()" gives and error "cannot be an iterator block because `void' is not an iterator interface type". Can anyone help me out on this one? Thanks P.S. I know my script is correct but it's my best shot at it and I'd stuck. It's in C# by the way. :) public class GameManager_Frank_GameOver : MonoBehaviour { private GameManager_Frank_Master gameManagerMaster; private Player_Master playerMaster; public GameObject panelGameOver; void OnEnable() { SetInitalReferecnes(); { gameManagerMaster.GameOverEvent += TurnOnGameOverPanel; } } void OnDisable() { gameManagerMaster.GameOverEvent -= TurnOnGameOverPanel; } void SetInitalReferecnes() { gameManagerMaster = GetComponent(); } void TurnOnGameOverPanel() { if (panelGameOver != null) { panelGameOver.SetActive(true); yield return new WaitForSeconds(6); Application.LoadLevel(1); } } } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>