protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { if (RenderSceneMesh != null) { RenderSceneMesh.Dispose(); _renderSceneMesh = null; } } disposedValue = true; } }
public override void UpdateRenderModel() { // If the model field changed, then update the visible model if (Type == MapEntityType.DS2Generator) { } else if (Type == MapEntityType.DS2EventLocation && RenderSceneMesh == null) { if (RenderSceneMesh != null) { RenderSceneMesh.Dispose(); } RenderSceneMesh = Universe.GetDS2EventLocationDrawable(ContainingMap, this); } else if (Type == MapEntityType.Region && RenderSceneMesh == null) { if (RenderSceneMesh != null) { RenderSceneMesh.Dispose(); } RenderSceneMesh = Universe.GetRegionDrawable(ContainingMap, this); } else { var model = GetPropertyValue <string>("ModelName"); if (model != null && model != CurrentModel) { RenderSceneMesh.Dispose(); CurrentModel = model; RenderSceneMesh = Universe.GetModelDrawable(ContainingMap, this, model); if (Universe.Selection.IsSelected(this)) { OnSelected(); } } } base.UpdateRenderModel(); }