Ejemplo n.º 1
0
        /// <summary>
        /// Begins loading resources for the game.
        /// </summary>
        /// <param name="handover">object[] { host, port, token }</param>
        public void Load(object handover)
        {
            try
            {
                // Instantiate network handler
                NetworkHandler = new LoginNetworkHandler();

                // Initiate Gui.
                Gui = new LoginMenuGui();
                Gui.OnLoginClicked += (s, a) => BeginLogin();
                Desktop.Root        = Gui;
            }
            catch (Exception e)
            {
                Trace.WriteLine("Exception in LoadGameScene.Load():");
                Trace.WriteLine(e.ToString());

                // Goto error scene.
                SceneManager.GotoScene <ErrorScene>();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Reset state.
 /// </summary>
 public void Unload()
 {
     Gui            = null;
     NetworkHandler = null;
     Desktop.Root   = null;
 }