Comments (4)
Great idea! I think that just adding the postfix "Changed" to the Event as the default name will suffice for now or what do you think @mutmedia? The tricky part implementing this would be to get the parent of of the SerializedProperty
in the AtomDrawer
. You would then use the name of the parent Atom (if there is one) + the name of the property of the Atom you are creating. Eg: if you have a Variable called MyVariable
and you click Create for the Changed
event of that Variable the default name would be MyVariableChanged
.
from unity-atoms.
(untested):
in the event drawer, you can get property.serializedObject.Name which should yield the Scripts's name or the scriptableObjects's asset name.
and of course you could get the property.Name to get the variable name itself.
scenario 1: you're in an IntVariable
AtomVariable named "fooBar" you click "create" for the "changed" event of type IntEvent.
scenario 2: you're on an GameObject Player in a Script named Health you click "create" for the "reachedZero" event of type BoolEvent.
pattern | scenario 1 | scenario 2 |
---|---|---|
<parent>On<Event> |
IntVariableOnChanged | HealthOnReachedZero |
<parent>Changed |
IntVariableChanged | HealthChanged |
<object name>Changed |
fooBarChanged | PlayerChanged |
<object name><parent>Changed |
IntVariablefooBarChanged | PlayerHealthChanged |
<object name><parent>On<Event> |
IntVariablefooBarOnChanged | PlayerHealthOnReachedZero |
from unity-atoms.
I think pattern 3 (row 3) works best for scenario 1, however it isn't great for scenario 2. Maybe we could via reflection see if the parent is an Atom Variable or not? If it is we use the <object name>Changed
pattern, otherwise we just default to AtomEvent
or maybe <property name>
?
from unity-atoms.
Fixed in #317
from unity-atoms.
Related Issues (20)
- [FEATURE] Upgrading Documentation to Docusaurus 2.x and adding a search plugin
- [BUG] NullReferenceException in HandlePlayModeStateChange HOT 1
- [BUG] AtomValueList keeps runtime modifications HOT 1
- [BUG] AtomValueList not compatible with disabled domain reload HOT 1
- [FEATURE] Improve Inspector legibility
- [BUG] FiniteStateMachine not firing events anymore HOT 2
- A number of issues with AtomLists/AtomCollections HOT 2
- [FEATURE] More public get-properties for fields HOT 2
- [QUESTION] Subpackages documentation HOT 2
- [FEATURE] Variable Resetter shouldn't trigger due to script hot reload
- [FEATURE] Clear "AtomList" and "AtomCollection" OnEnable
- [FEATURE] SceneField for Addressable Scenes
- [BUG] StackTraces allocate garbage when DebugMode = false HOT 1
- [BUG] QuaternionReferenceDrawer Rendering issue HOT 1
- [BUG] CustomStruct Reference Drawer Rendering issue
- [FEATURE] AtomTags - Update TagInstances in Editor
- [FEATURE] Auto drag and drop atom references through inspector without the need to manually switch usage type
- [FEATURE] AtomBaseEventReference to have `Raise` methods inside
- [FEATURE] VFX PropertyBinder HOT 1
- [BUG] Recompiling during play mode resets all variables HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unity-atoms.