I was wondering about this too and tried it, I can get it to work with a plugin, but not with a behavior (it looks the the OnPropertyChanged function is not called when changing the property of the behaior on an instance.
Here's the code from the top-level instance.js (using the SDK behavior example to test from here: construct.net/en/make-games/manuals/addon-sdk )
"use strict";
{
const BEHAVIOR_CLASS = SDK.Behaviors.MyCompany_MyBehavior;
BEHAVIOR_CLASS.Instance = class MyCustomBehaviorInstance extends SDK.IBehaviorInstanceBase
{
constructor(sdkBehType, behInst)
{
super(sdkBehType, behInst);
}
Release()
{
}
OnCreate()
{
}
OnPropertyChanged(id, value)
{
console.log("***INFO*** id:"+id+" value:"+value);
debugger
}
LoadC2Property(name, valueString)
{
return false; // not handled
}
};
}