Exemplo n.º 1
0
 public static void DelRes()
 {
     //释放所有资源
     resManager.Clear();
     room         = new Rooms.Room();
     player       = new PlayerData();
     inputManager = new Input();
     camara       = new Camera();
     ppDevice.Clear();
     ppDevice = null;
     windowsList.Clear();
     windowsList = new Window_List();
     SpriteBase.ClearAll();
 }
Exemplo n.º 2
0
        private void FormGame_Load(object sender, EventArgs e)
        {
            {
                try
                {
                    if (Global.GetSoundManager() != null)
                    {
                        Global.GetSoundManager().DelRes();
                    }
                    var s = new Data.Sounds.Sound(this);
                    Global.SetSoundManager(s);
                }
                catch (Exception)
                {
                }

                ppDevice = new PPDevice(this, this.Draw);
                Global.SetPPDevice(ppDevice);

                xml = Global.GetXmlManager();
                xml.Load();
                input  = Global.GetInput();
                camera = Global.GetCamara();
                res    = Global.GetResManager();
                res.LoadItemPic();
                res.LoadPic();
                windowList = Global.GetWindowsList();
                //Global.Getconfig = new Config();
                //Global.Getshop = new ShopManager();


                windowList.Load();
                windowList.CloseAll();
                windowList.ActiveWindow(19);
                Global.GetRoom().AddPlayer(Global.GetPlayer());
                Global.GetRoom().clientC = Global.GetClientC();
                sw.Start();

                thread = new Thread(new ThreadStart(Action));
                thread.Start();
                Global.IsFormGameOpen = true;
            }
        }