Пример #1
0
        private static void CheckFields(SRMonoBehaviourEx instance, bool justSet = false)
        {
            if (_checkedFields == null)
            {
                _checkedFields = new Dictionary <Type, IList <FieldInfo> >();
            }

            var t = instance.GetType();

            IList <FieldInfo> cache;

            if (!_checkedFields.TryGetValue(instance.GetType(), out cache))
            {
                cache = ScanType(t);

                _checkedFields.Add(t, cache);
            }

            PopulateObject(cache, instance, justSet);
        }
        private static void CheckFields(SRMonoBehaviourEx instance, bool justSet = false)
        {
            if (_checkedFields == null)
            {
                _checkedFields = new Dictionary<Type, IList<FieldInfo>>();
            }

            var t = instance.GetType();

            IList<FieldInfo> cache;

            if (!_checkedFields.TryGetValue(instance.GetType(), out cache))
            {
                cache = ScanType(t);

                _checkedFields.Add(t, cache);
            }

            PopulateObject(cache, instance, justSet);
        }