Skip to content

Commit

Permalink
prevent redundant syncing of editor settings window
Browse files Browse the repository at this point in the history
- saves ~10% of time
  • Loading branch information
mrDIMAS committed Nov 10, 2024
1 parent bf80ecf commit 79352c2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion editor/src/scene/settings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ use crate::{
use crate::command::make_command;
use crate::fyrox::core::reflect::Reflect;
use crate::scene::commands::GameSceneContext;
use fyrox::graph::{BaseSceneGraph, SceneGraph};
use fyrox::gui::window::Window;
use std::sync::Arc;

pub struct SceneSettingsWindow {
Expand Down Expand Up @@ -104,7 +106,15 @@ impl SceneSettingsWindow {
}

pub fn sync_to_model(&self, game_scene: &GameScene, engine: &mut Engine) {
let ui = &mut engine.user_interfaces.first_mut();
let ui = engine.user_interfaces.first_mut();
if !ui
.try_get_of_type::<Window>(self.window)
.unwrap()
.is_globally_visible()
{
return;
}

let scene = &engine.scenes[game_scene.scene];

let context = InspectorContext::from_object(
Expand Down

0 comments on commit 79352c2

Please sign in to comment.