Closed BradlyBarnacles closed 1 year ago
@BradlyBarnacles I'm testing right now, I'm also testing that there is no breaking change
Hey @BradlyBarnacles everything works well!! Only "Node" property type is broken. For example:
@visibleInInspector("Node", "Light to track", "sun", {
allowedNodeType: "Light",
})
public node: DirectionalLight;
Generates the following error
src/scenes/error.ts:10:6 - error TS2345: Argument of type 'MyScript' is not assignable to parameter of type 'Record<"node", string | number | boolean | Texture | Vector2 | Vector3 | Vector4 | Color3 | Color4 | Node>'.
Types of property 'node' are incompatible.
Type 'DirectionalLight' is not assignable to type 'string | number | boolean | Texture | Vector2 | Vector3 | Vector4 | Color3 | Color4 | Node'.
Type 'DirectionalLight' is missing the following properties from type 'Texture': url, uOffset, vOffset, uScale, and 110 more.
10 @visibleInInspector("Node", "Light to track", "sun", {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11 allowedNodeType: "Light",
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 })
Also, unfortunately having support of private members is mandatory in order to avoid breaking changes :(
Also, unfortunately having support of private members is mandatory in order to avoid breaking changes :
Cool, will fix that
@BradlyBarnacles hope you are going well! Do you have any news about that feature? It looks awesome to have
@BradlyBarnacles hope you are going well! Do you have any news about that feature? It looks awesome to have @julien-moreau unfortunately i think it might not be possible since the decorator can be added to private properties. Going to have one more look at it but will probably close the pull request
Links the type of inspector field ("number", "string", "KeyMap" ... ect) to the defaultValue type and options it has. For insance;
would produce an error due to incorrect default value and options.
tthis also helps in ScriptInspector component