using UnityEngine; namespace QFramework.Example { public class BindablePropertyExample : MonoBehaviour { private BindableProperty mSomeValue = new BindableProperty(0); private BindableProperty mName = new BindableProperty("QFramework"); void Start() { mSomeValue.Register(newValue => { Debug.Log(newValue); }).UnRegisterWhenGameObjectDestroyed(gameObject); mName.RegisterWithInitValue(newName => { Debug.Log(mName); }).UnRegisterWhenGameObjectDestroyed(gameObject); } void Update() { if (Input.GetMouseButtonDown(0)) { mSomeValue.Value++; } } } }