Add a checkbox to inspector, how to react to it?

I’m doing this:

this_inspectorLogGMaterial = () => {
console.log(“log”);
};

this.inspectableCustomProperties.push({
label: “Log”,
propertyName: “_inspectorLogGMaterial”,
type: InspectableType.Checkbox,
});

…but this does not work at all. Anyone knows how to connect it?

Is it that I need to use Babylon Gui and do a checkbox-object?

You can define a getter/setter for your property and use the setter to know that the value has been changed:

I’m not sure there’s a more direct way (like a callback or an observer) to know that a value has been changed… I think @Deltakosh will know.

2 Likes

This is excellent! Exactly what I was looking for.

This is the way :slight_smile: