Example #1
0
        public static bool AddRange <T>(string memberName, MinMaxFloat range)
        {
            var infos     = TypeUtility.GetMemberInfoList(typeof(T));
            var info      = infos.FirstOrDefault(fi => fi.Name == memberName);
            var hasMember = (info != null);

            if (hasMember)
            {
                info.range = range;
            }

            return(hasMember);
        }
            public MemberFieldInfo(FieldInfo info)
            {
                this.info = info;
                var rangeAttr = info.GetCustomAttribute <RangeAttribute>();

                if (rangeAttr != null)
                {
                    range = new MinMaxFloat()
                    {
                        min = rangeAttr.min,
                        max = rangeAttr.max
                    };
                }
            }