#[reflect(Default)]
for Handle/Mesh2dHandle (#12264)
# Objective - Make default handles constructible via reflection ## Solution - Add missing `#[reflect(Default)]` to them --------- Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
This commit is contained in:
parent
541a321a3d
commit
fadc6d08c1
@ -3,7 +3,7 @@ use crate::{
|
|||||||
UntypedAssetId,
|
UntypedAssetId,
|
||||||
};
|
};
|
||||||
use bevy_ecs::prelude::*;
|
use bevy_ecs::prelude::*;
|
||||||
use bevy_reflect::{Reflect, TypePath};
|
use bevy_reflect::{std_traits::ReflectDefault, Reflect, TypePath};
|
||||||
use bevy_utils::{get_short_name, Uuid};
|
use bevy_utils::{get_short_name, Uuid};
|
||||||
use crossbeam_channel::{Receiver, Sender};
|
use crossbeam_channel::{Receiver, Sender};
|
||||||
use std::{
|
use std::{
|
||||||
@ -122,7 +122,7 @@ impl std::fmt::Debug for StrongHandle {
|
|||||||
///
|
///
|
||||||
/// [`Handle::Strong`] also provides access to useful [`Asset`] metadata, such as the [`AssetPath`] (if it exists).
|
/// [`Handle::Strong`] also provides access to useful [`Asset`] metadata, such as the [`AssetPath`] (if it exists).
|
||||||
#[derive(Component, Reflect)]
|
#[derive(Component, Reflect)]
|
||||||
#[reflect(Component)]
|
#[reflect(Default, Component, Debug, Hash, PartialEq)]
|
||||||
pub enum Handle<A: Asset> {
|
pub enum Handle<A: Asset> {
|
||||||
/// A "strong" reference to a live (or loading) [`Asset`]. If a [`Handle`] is [`Handle::Strong`], the [`Asset`] will be kept
|
/// A "strong" reference to a live (or loading) [`Asset`]. If a [`Handle`] is [`Handle::Strong`], the [`Asset`] will be kept
|
||||||
/// alive until the [`Handle`] is dropped. Strong handles also provide access to additional asset metadata.
|
/// alive until the [`Handle`] is dropped. Strong handles also provide access to additional asset metadata.
|
||||||
|
@ -10,7 +10,7 @@ use bevy_ecs::{
|
|||||||
system::{lifetimeless::*, SystemParamItem, SystemState},
|
system::{lifetimeless::*, SystemParamItem, SystemState},
|
||||||
};
|
};
|
||||||
use bevy_math::{Affine3, Vec4};
|
use bevy_math::{Affine3, Vec4};
|
||||||
use bevy_reflect::Reflect;
|
use bevy_reflect::{std_traits::ReflectDefault, Reflect};
|
||||||
use bevy_render::mesh::MeshVertexBufferLayoutRef;
|
use bevy_render::mesh::MeshVertexBufferLayoutRef;
|
||||||
use bevy_render::{
|
use bevy_render::{
|
||||||
batching::{
|
batching::{
|
||||||
@ -39,7 +39,7 @@ use crate::Material2dBindGroupId;
|
|||||||
///
|
///
|
||||||
/// It wraps a [`Handle<Mesh>`] to differentiate from the 3d pipelines which use the handles directly as components
|
/// It wraps a [`Handle<Mesh>`] to differentiate from the 3d pipelines which use the handles directly as components
|
||||||
#[derive(Default, Clone, Component, Debug, Reflect, PartialEq, Eq)]
|
#[derive(Default, Clone, Component, Debug, Reflect, PartialEq, Eq)]
|
||||||
#[reflect(Component)]
|
#[reflect(Default, Component)]
|
||||||
pub struct Mesh2dHandle(pub Handle<Mesh>);
|
pub struct Mesh2dHandle(pub Handle<Mesh>);
|
||||||
|
|
||||||
impl From<Handle<Mesh>> for Mesh2dHandle {
|
impl From<Handle<Mesh>> for Mesh2dHandle {
|
||||||
|
Loading…
Reference in New Issue
Block a user