Esempio n. 1
0
        public static void OnGameStart()
        {
            SceneSelector selector = null;

            foreach (var scene in ContentProvider.GetAvailableContent <Scene>())
            {
                selector = scene.Res?.FindComponent <SceneSelector>() ?? selector;
            }

            if (selector == null)
            {
                Logs.Game.WriteWarning("Unable to set scenes, SceneSelector not found.");
            }
            else
            {
                _gameScene = selector.Game;
                _menuScene = selector.Menu;


                if (_gameScene.Res == null || _menuScene.Res == null)
                {
                    Logs.Game.WriteWarning("Scene Selector ContentRefs aren't available, unable to set scenes.");
                }
            }

            OldContext.ClearNotifications();
        }
Esempio n. 2
0
        public static void Cleanup()
        {
            var networker = CupboardApp.Networker;

            // This is silly. Perhaps keep a private ref to the original networker instead?
            if (networker != null)
            {
                networker.Joined          -= Networker_Joined;
                networker.Disconnected    -= Networker_Disconnected;
                networker.UnexpectedError -= Networker_UnexpectedError;
                networker.DataRecieved    -= Networker_DataRecieved;
            }

            OldContext.ClearNotifications();
        }