protected void PrepareBindingRoot() { // Apply root if needed if (!useBindingRoot) { return; } // cache root, bad when reparent object, but good for performance if (_cachedBindingRoot == null) { _cachedBindingRoot = GetComponentInParent <BindingRoot>(); } sourceObject = _cachedBindingRoot ? _cachedBindingRoot.sourceObject : null; }
private void PrepareBindingRoot() { // Apply root if needed if (!useBindingRoot) { return; } // cache root, bad when reparent object, but good for performance if (_cachedBindingRoot == null) { _cachedBindingRoot = GetComponentInParent <BindingRoot>(); } sourceObject = _cachedBindingRoot ? _cachedBindingRoot.sourceObject : null; // clear source object getter and setter if (sourceObject != _lastSourceObject) { _lastSourceObject = sourceObject; _onGetValue = null; _onSetValue = null; } }