You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`AspectRatioAdapter`| Two numbers (W x H) |`@syncedValue(AspectRatioAdapter) ratio = [16, 9]`|
55
+
|`enumAdapter`| Dropdown enum | See example below |
56
+
57
+
### enumAdapter
58
+
`enumAdapter` allows you to specify a set of choices as valid values. This also conveniently as a drop down menu in the editor. They are used like this:
This is useful if you want to expose the value to the editor or other scripts without networking it. If you change it on one client, the other clients or server don't get updated. For example:
You might have noticed the syntax for the counter above was gross because @syncedValue forces us to pass a type to access the overrides.
87
+
If you want to override replicated on a primitive value, you can use `@value` which has a slightly different method signature of `{type, ...overrides}`
The only difference between `@syncedValue` and `@value` is the arrangement of the arguments. `@value` allows you to set overrides without specifying a type.
107
+
Both are valid ways of representing the same thing.
0 commit comments