bevy/crates/bevy_reflect/src
Mark Schmale 5b00af01d7 Make arrays behave like lists in reflection (#5987)
# Objective

Currently, arrays cannot indexed using the reflection path API. 
This change makes them behave like lists so `x.get_path("list[0]")` will behave the same way, whether x.list is a "List" (e.g. a Vec) or an array.

## Solution

When syntax is encounterd `[ <idx> ]` we check if the referenced type is either a `ReflectRef::List` or `ReflectRef::Array`   (or `ReflectMut` for the mutable case). Since both provide the identical API for accessing entries, we do the same for both, although it requires code duplication as far as I can tell. 


This was born from working on #5764, but since this seems to be an easier fix (and I am not sure if I can actually solve #5812) I figured it might be worth to split this out.
2022-09-27 18:11:38 +00:00
..
enums bevy_reflect: Improve serialization format even more (#5723) 2022-09-20 19:38:18 +00:00
impls bevy_reflect: Improve serialization format even more (#5723) 2022-09-20 19:38:18 +00:00
serde bevy_reflect: Improve serialization format even more (#5723) 2022-09-20 19:38:18 +00:00
array.rs Implement Debug for dynamic types (#5948) 2022-09-19 16:36:37 +00:00
fields.rs bevy_reflect: Improve serialization format even more (#5723) 2022-09-20 19:38:18 +00:00
lib.rs bevy_reflect: Improve serialization format even more (#5723) 2022-09-20 19:38:18 +00:00
list.rs bevy_reflect: Get owned fields (#5728) 2022-08-30 21:20:58 +00:00
map.rs bevy_reflect: Get owned fields (#5728) 2022-08-30 21:20:58 +00:00
path.rs Make arrays behave like lists in reflection (#5987) 2022-09-27 18:11:38 +00:00
reflect.rs bevy_reflect: Update Reflection documentation (#5841) 2022-09-02 16:17:45 +00:00
std_traits.rs add #[reflect(Default)] to create default value for reflected types (#3733) 2022-05-03 19:20:13 +00:00
struct_trait.rs bevy_reflect: Improve serialization format even more (#5723) 2022-09-20 19:38:18 +00:00
tuple.rs Add reflect(skip_serializing) which retains reflection but disables automatic serialization (#5250) 2022-09-19 16:12:10 +00:00
tuple_struct.rs bevy_reflect: Improve serialization format even more (#5723) 2022-09-20 19:38:18 +00:00
type_info.rs bevy_reflect: Improve serialization format even more (#5723) 2022-09-20 19:38:18 +00:00
type_registry.rs Add reflect(skip_serializing) which retains reflection but disables automatic serialization (#5250) 2022-09-19 16:12:10 +00:00
type_uuid.rs re-enable #[derive(TypeUuid)] for generics (#4118) 2022-04-26 19:41:25 +00:00
utility.rs bevy_reflect: Improve serialization format even more (#5723) 2022-09-20 19:38:18 +00:00