Variable mappings can't see properties without accessors

Zurigan

New member
Code:
public float AttackRange = 1.5f;

Can't be used to map to, doesn't appear when looking at entity variables.

Code:
private float _attackSpeed = 2f;
public float AttackSpeed => _attackSpeed;

On the other hand, can :)
 
Variable mapping works on properties, not on fields, so this is by design. Variable mapping uses reflection and using reflection on fields is extremely slow.
 
Variable mapping works on properties, not on fields, so this is by design. Variable mapping uses reflection and using reflection on fields is extremely slow.

Ah good to know ... this does feel rather non-intuitive, maybe an explicit callout in the docs would be helpful for others like me wondering what's going on!
 
Top