示例#1
0
        private void CacheProperty(SerializedProperty property)
        {
            if (_memberInfo != null && _target != null)
            {
                return;
            }

            _target     = property.serializedObject.targetObject;
            _memberInfo = null;
            var path = property.propertyPath.Split('.');

            for (var i = 0; i < path.Length; i++)
            {
                var cachedType = mCore.GetCachedType(_target.GetType());
                _memberInfo = cachedType.GetFieldOrProperty(path[i]);
                var value = _memberInfo.GetValue(_target);

                if (i + 1 < path.Length)
                {
                    _target = value;
                }
            }
        }
示例#2
0
 private UIColor GetValue()
 {
     return((UIColor)_memberInfo.GetValue(_target));
 }