From 98f1398b9f6c9cb7a8687bf8924c200239d51455 Mon Sep 17 00:00:00 2001 From: rewin Date: Fri, 15 Mar 2024 20:04:38 +0300 Subject: [PATCH] Some more bugs fixed --- studio/src/math/geo.rs | 10 +++++----- studio/src/mixamo.rs | 2 +- studio/src/persistance/mod.rs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/studio/src/math/geo.rs b/studio/src/math/geo.rs index bbf0884..492cd65 100644 --- a/studio/src/math/geo.rs +++ b/studio/src/math/geo.rs @@ -1,7 +1,7 @@ use bevy::{ math::vec3, prelude::*, - render::{mesh::Indices, primitives::Aabb, render_resource::PrimitiveTopology}, + render::{mesh::Indices, primitives::Aabb, render_asset::RenderAssetUsages, render_resource::PrimitiveTopology}, }; pub struct Cone { @@ -45,8 +45,8 @@ impl From for Mesh { positions.push(vec3(0., c.length, 0.)); - let mut mesh = Mesh::new(PrimitiveTopology::TriangleList); - mesh.set_indices(Some(Indices::U32(indices))); + let mut mesh = Mesh::new(PrimitiveTopology::TriangleList, RenderAssetUsages::all()); + mesh.insert_indices(Indices::U32(indices)); mesh.insert_attribute(Mesh::ATTRIBUTE_POSITION, positions); mesh @@ -104,8 +104,8 @@ impl From for Mesh { 2, 3, 1, ]; - let mut mesh = Mesh::new(PrimitiveTopology::TriangleList); - mesh.set_indices(Some(Indices::U32(indices))); + let mut mesh = Mesh::new(PrimitiveTopology::TriangleList, RenderAssetUsages::all()); + mesh.insert_indices(Indices::U32(indices)); mesh.insert_attribute(Mesh::ATTRIBUTE_POSITION, positions); mesh diff --git a/studio/src/mixamo.rs b/studio/src/mixamo.rs index e47009c..d56e265 100644 --- a/studio/src/mixamo.rs +++ b/studio/src/mixamo.rs @@ -6,7 +6,7 @@ pub struct MixamoPlugin; impl Plugin for MixamoPlugin { fn build(&self, app: &mut App) { app.add_event::(); - app.add_state::(); + app.init_state::(); app.add_systems( Update, diff --git a/studio/src/persistance/mod.rs b/studio/src/persistance/mod.rs index d1ea77e..2092378 100644 --- a/studio/src/persistance/mod.rs +++ b/studio/src/persistance/mod.rs @@ -31,11 +31,11 @@ impl EditorTab for DebugPersistanceTab { world: &mut World, ) { if ui.button("Save").clicked() { - world.send_event(EditorEvent::Save(EditorPrefabPath::MemoryCahce)); + world.send_event(EditorEvent::Save(EditorPrefabPath::MemoryCache)); } if ui.button("Load").clicked() { - world.send_event(EditorEvent::Load(EditorPrefabPath::MemoryCahce)); + world.send_event(EditorEvent::Load(EditorPrefabPath::MemoryCache)); } if ui.button("Clear level").clicked() { @@ -68,7 +68,7 @@ mod wasm { pub(super) fn forward_save_scene_events(mut ew_editor_events: EventWriter) { if SAVE_SCENE.take_message().is_some() { - ew_editor_events.send(EditorEvent::Save(EditorPrefabPath::MemoryCahce)); + ew_editor_events.send(EditorEvent::Save(EditorPrefabPath::MemoryCache)); } }