pancake-llc / foundation

Game Mobile Foundation (Android + iOS) Using Unity3D. Simple, Fast and no GC
MIT License
111 stars 16 forks source link

Venting: Apex is Bad on Listening to changes on ScriptableObject. `ScriptableVariableBase` was a lifesaver #116

Closed IAFahim closed 8 months ago

IAFahim commented 8 months ago
  1. Apex doesn't let inspector update when any scriptable variable value is changed, but the ScriptableVariableBase was a lifesaver as it would let the update of scriptable object directly.

https://github.com/pancake-llc/foundation/assets/63500913/ac96b3fa-9aa4-4df7-aeee-53d2b82c27ce

  1. Scriptable Base also provided the ability to have a peak of the variable value without have to open the drop-down to see the value.

  2. Currently, No ScriptableVaraible is viewable in Apex → Array Attribute image

aprius commented 8 months ago
  1. Displaying scriptable Input event information seems unnecessary (so far I have not seen a case where I need to use the Raise button for these events) so I have removed the scriptable input drawer in this commit and before this script. which has not done anything yet

now it will look like this

image

aprius commented 8 months ago
  1. This functionality was there before but I removed it for extension compatibility when creating classes that inherit from ScriptableBase (for compatibility with using attributes from apex) because this feature needs a customEditor for scriptableVariable so it conflict will occur. I'll think more about this, seeing the value without having to open the window is more convenient.
aprius commented 8 months ago
  1. I'll try to find a way to make it work, maybe calling Repaint isn't enough
IAFahim commented 8 months ago

Thank you kind Sir, for taking a look into this matter. God bless you.

aprius commented 8 months ago
  1. Done, now do not cache editor to fetch directly value of scriptable (It will affect performance in case the scriptable's data uses resource-intensive attributes such as NamePickupAttribute) see changed in commit
aprius commented 8 months ago
  1. Done, add draw preview single value of scriptable with name property specify is value. see changed in commit
aprius commented 8 months ago

@IAFahim Try checking again to see if it works for you?

IAFahim commented 8 months ago

Works perfectly. Freezing, the whole scriptable object view was quite nice. Now the inspector view of scriptable view and scriptable object view looks same, So changing stuff on both view is more fun.

You are quite something. Thank you, Sir.