예제 #1
0
파일: Scene.cs 프로젝트: sing840722/FlyFly
 protected void SendDestroyEvent(SceneEventArgs e)
 {
     if (OnDestroyEvent != null)
     {
         OnDestroyEvent(this, e);
     }
 }
예제 #2
0
파일: Scene.cs 프로젝트: sing840722/FlyFly
 protected void SendLoadEvent(SceneEventArgs e)
 {
     if (OnLoadEvent != null)
     {
         OnLoadEvent(this, e);
     }
 }
예제 #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;
            }
        }
예제 #4
0
파일: Scene.cs 프로젝트: sing840722/FlyFly
 protected void SendCreateEvent(SceneEventArgs e)
 {
     if (OnCreateEvent != null)
     {
         OnCreateEvent(this, e);
     }
 }
예제 #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;
            }
        }