Inheritance: MonoBehaviour
Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        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;
            }
        }