public static void OnPropChanged(ModelPropChangedData changedData) { if (ModelBinder.Instance != null) { ModelBinder.Instance._OnPropChanged(changedData); } }
void _OnPropChanged(ModelPropChangedData changedData) { if (changedData.delay > 0) { _delayedEvents.Add(changedData); return; } InvokeListeners(changedData.propKey, changedData.changeValue); }
void Update() { if (_delayedEvents.Count > 0) { for (int i = _delayedEvents.Count - 1; i >= 0; i--) { ModelPropChangedData data = _delayedEvents [i]; data.delay -= Time.deltaTime; if (data.delay <= 0) { _delayedEvents.RemoveAt(i); InvokeListeners(data.propKey, data.changeValue); } } } }