#Custom inspector for IComponentData in entities hierarchy

1 messages · Page 1 of 1 (latest)

pulsar rain
#

Hey, I can't find any useful resources for creating custom property drawers or editors for use within DOTS, apart from [CreateProperty]. I'm using some custom data types for things like floats and Vectors in my game logic in order to enforce determinism and need to convert these to float and float3 to check their values at runtime. I CAN get the result that I want with something like:

public struct myComponent : IComponentData {
    Fixed64 myFloat;
    [CreateProperty] public float displayFloat => myFloat.ToFloat();
}```

I could probably pack this behind some editor-only preprocessor block, but that can't possibly be the only way to achieve this.

Thanks so much!
slow crystal
#

It requires internal access to the entities package

#

If you're willing to give yourself that then you can just implement PropertyInspector<T>

#

An example

pulsar rain
#

Ah, thanks. I did find something about that, but couldn't figure out what namespace to pull from.

pulsar rain
slow crystal
#

No, you can use asmref to get internal access

#

By injecting internalvisibleto