Exemple #1
0
        public void OnGameStart()
        {
            AudioManager.PlayTrigger("game_start");

            if (!Env.IsSandbox)
            {
                Env.Console.ExecuteString("map Canyon");
            }

            GameApp = Application.Instantiate <SydewinderApp>();

            // Initialize Highscore with file name.
            Highscore.InitializeFromFile(HIGHSCORE_URL);

            GameApp.GameOver += showHighscore =>
            {
                // Reset field of view to ehance 3D look.
                Camera.FieldOfView = 60f;

                UI.MainMenu.SetInactive();
                if (showHighscore)
                {
                    UI.MainMenu.SetupHighscoreMenuPerspective();
                }
                else
                {
                    UI.MainMenu.SetupMainMenuPerspective();
                }
            };

            InitializeMainMenu();
        }
Exemple #2
0
 /// <summary>
 /// Called when engine is being shut down or if application is reloaded.
 /// </summary>
 public override void Shutdown()
 {
     if (GameApp != null)
     {
         UI.MainMenu.DestroyMenu();
         GameApp.Shutdown(false);
         GameApp.Destroy();
         GameApp = null;
     }
 }
Exemple #3
0
 public override void Initialize()
 {
     GameApp = Application.Instantiate <SydewinderApp>();
 }