Esempio n. 1
0
        public void LoadWorld(String filename)
        {
            foreach (Body b in world.BodyList)
            {
                b.Dispose();
            }
            world.ProcessChanges();


            SaveFile sf = Serializer.readFromDataContract(filename);

            world = new World(sf.gravity);
            debugview.AttachToWorld(world);
            sf.PopulateWorld(world);
            game.ragdollManager.ragdoll = sf.ragdoll;
            game.ragdollManager.ragdoll.Init(world);
            //game.ragdollManager.ragdoll.setDepthTex(game.kinectManager.depthTex);
            game.objectiveManager.SetObjectives(sf.objectives);
            game.powerupManager.LoadPowerups(sf.powerups);
            game.hazardManager.LoadHazards(sf.hazards);
        }