private void LoadWorldNow(IResource resource) { if (resource.Equals(CurrentResource)) { return; } CurrentResource = null; worldBuffers = new WorldBuffers(diContainer, resource); AddDisposable(worldBuffers); worldRenderer.WorldBuffers = worldBuffers; modelMaterialEdit.Materials = materials; CurrentResource = resource; UpdateSectionDepths(); worldCollider = new WorldCollider(worldBuffers.RWWorld); HighlightSection(-1); controls.ResetView(); camera.Location.LocalPosition = -worldBuffers.Origin; fbArea.IsDirty = true; Window.Title = $"World Viewer - {resource.Path.ToPOSIXString()}"; }
private void LoadSceneNow(IResource resource) { if (resource.Equals(CurrentResource)) { return; } CurrentResource = null; localDiContainer.GetTag <IAssetLoader <Texture> >().Clear(); localDiContainer.GetTag <IAssetLoader <ClumpBuffers> >().Clear(); using var contentStream = resource.OpenContent(); if (contentStream == null) { throw new IOException($"Could not open scene at {resource.Path.ToPOSIXString()}"); } scene = new Scene(); scene.Read(contentStream); CurrentResource = resource; controls.ResetView(); fbArea.IsDirty = true; Window.Title = $"Scene Editor - {resource.Path.ToPOSIXString()}"; OnLoadScene(); }