added property editor for untyped textures

This commit is contained in:
Dmitry Stepanov
2024-03-18 21:21:11 +03:00
parent f97cb1184a
commit 456788847c
2 changed files with 6 additions and 1 deletions
+3
View File
@@ -93,6 +93,7 @@ use crate::{
},
message::MessageSender,
};
use fyrox::asset::untyped::UntypedResource;
use std::{path::Path, sync::Arc};
pub mod animation;
@@ -198,7 +199,9 @@ pub fn make_property_editors_container(sender: MessageSender) -> PropertyEditorD
container.insert(FontPropertyEditorDefinition);
container.insert(InheritablePropertyEditorDefinition::<FontResource>::new());
container.insert(InheritablePropertyEditorDefinition::<Option<TextureResource>>::new());
container.insert(InheritablePropertyEditorDefinition::<Option<UntypedResource>>::new());
container.register_inheritable_vec_collection::<Option<TextureResource>>();
container.register_inheritable_vec_collection::<Option<UntypedResource>>();
container.insert(MaterialPropertyEditorDefinition {
sender: Mutex::new(sender.clone()),
+3 -1
View File
@@ -12,6 +12,7 @@ use crate::{
MODEL_RESOURCE_UUID, SHADER_RESOURCE_UUID, SOUND_BUFFER_RESOURCE_UUID, TEXTURE_RESOURCE_UUID,
};
use fyrox_core::math::curve::Curve;
use fyrox_core::uuid;
use fyrox_core::visitor::RegionGuard;
use std::ffi::OsStr;
use std::fmt::Display;
@@ -243,7 +244,8 @@ impl Visit for ResourceHeader {
/// that the resource is in default state. This is a trade-off to prevent wrapping internals into
/// `Option`, that in some cases could lead to convoluted code with lots of `unwrap`s and state
/// assumptions.
#[derive(Clone, Reflect)]
#[derive(Clone, Reflect, TypeUuidProvider)]
#[type_uuid(id = "21613484-7145-4d1c-87d8-62fa767560ab")]
pub struct UntypedResource(pub Arc<Mutex<ResourceHeader>>);
impl Visit for UntypedResource {