private Physics CreatePhysics(ErrorCallback errorCallback = null) { if (Physics.Instantiated) { Assert.Fail("Physics is still created"); } if (errorCallback == null) { errorCallback = _errorLog = new ErrorLog(); } if (_physics != null) { _physics.Dispose(); _physics = null; } if (_foundation != null) { _foundation.Dispose(); _foundation = null; } _foundation = new Foundation(errorCallback); _physics = new Physics(_foundation, checkRuntimeFiles: true); return(_physics); }
public void CleanUp() { if (Physics.Instantiated) { _foundation.Dispose(); _foundation = null; throw new Exception("After a test has run, the Physics singleton should have been disposed"); } ObjectTable.Clear(); if (_errorLog != null && _errorLog.HasErrors) { Trace.TraceError("There were errors, check the error log"); } _errorLog = null; }