public void DisablePhysics() { lock ( physicsLock ) { sandPhysics = null; snowPhysics = null; plantPhysics = null; waterPhysics = null; lavaPhysics = null; tickQueue.Clear(); physicsEnabled = false; } Logger.Log("Map: Physics disabled."); }
public void EnablePhysics() { Stopwatch sw = Stopwatch.StartNew(); lock ( physicsLock ) { sandPhysics = new SandPhysics(this); snowPhysics = new SnowPhysics(this); plantPhysics = new PlantPhysics(this); waterPhysics = new WaterPhysics(this); lavaPhysics = new LavaPhysics(this); physicsEnabled = true; } sw.Stop(); Logger.Log("Map: Physics enabled in {0}ms", sw.ElapsedMilliseconds); }