Example #1
0
 protected void SendDestroyEvent(SceneEventArgs e)
 {
     if (OnDestroyEvent != null)
     {
         OnDestroyEvent(this, e);
     }
 }
Example #2
0
 protected void SendLoadEvent(SceneEventArgs e)
 {
     if (OnLoadEvent != null)
     {
         OnLoadEvent(this, e);
     }
 }
Example #3
0
        //Unload content
        //Can do audio.play etc
        public void OnDestroyScene(object sender, SceneEventArgs e)
        {
            //Console.Write("EXIT: " + e.Name + "\n");
            switch (e.Name)
            {
            case "Menu":
                //MediaPlayer.Stop();
                widgetManager.DestroyWidget(widgetManager.Menu);
                menuContents.UnloadContents();
                break;

            case "Level":
                //MediaPlayer.Stop();
                widgetManager.DestroyWidget(widgetManager.LevelHUD);
                levelContents.UnloadContents();
                break;

            case "EndScreen":
                widgetManager.DestroyWidget(widgetManager.EndScreen);
                endScreenContents.UnloadContents();
                break;

            default:
                break;
            }
        }
Example #4
0
 protected void SendCreateEvent(SceneEventArgs e)
 {
     if (OnCreateEvent != null)
     {
         OnCreateEvent(this, e);
     }
 }
Example #5
0
        //Load content, create widget (2D stuff), Setup keyBinding
        public void OnLoadScene(object sender, SceneEventArgs e)
        {
            switch (e.Name)
            {
            case "Menu":
                menuContents.LoadContents();
                widgetManager.CreateMenuWidgets();
                SetMenuKeyBinding();
                MediaPlayer.Play(menuContents.BackgroundMusic);
                break;

            case "Level":
                levelContents.LoadContents();
                widgetManager.CreateLevelWidgets();
                SetLevelKeyBinding();
                MediaPlayer.Play(levelContents.BackgroundMusic);
                break;

            case "EndScreen":
                endScreenContents.LoadContents();
                widgetManager.CreateEndScreenWidgets();
                scoreManager.UpdateLeaderBoard();
                SetEndScreenKeyBinding();
                MediaPlayer.Play(endScreenContents.BackgroundMusic);
                break;

            default:
                break;
            }
        }