Closed DoubleStyx closed 2 years ago
Thinking about the design for how something like this would be used in-game. One commonly proposed idea is an interface-card-style node that allows you to specify a component reference and read/write values from there. The main issue with this approach is that you have to declare the type beforehand. Ideally, you’d be able to specify a type, the field you want from the type, and a reference to a component instance.
Specifying a type is fairly straightforward currently, although it would be nice in the future to have a graphical alternative to manually entering the type name. Declaring a particular field would likely require a string containing the field’s name.
We should try to avoid straying too far into C# Reflection territory. Reflection would definitely be the easiest way to implement component access, but the performance hit might not be acceptable. I know @RileyGuy has experimented with alternatives to reflection, though I don’t know if those approaches would be applicable here.
Reflectionless field access: https://github.com/DoubleStyx/NeosPlus/blob/main/Logix/Components/GetField.cs
Still need to add additional nodes for getting the components themselves.
Or maybe we'll implement something similar to dynamic interface cards.
I don't think we're going to do this. At least not with the current state of Neos' permissions system. Feel free to build your own version of NeosPlus using this branch, though. Maybe close this issue?
Allow specifying value or reference fields to target for a component. Allow reading/writing fields.