Пример #1
0
        public void GetAttribute_memeberInfo_false()
        {
            Type            t      = typeof(MyBaseTestClass);
            MyTestAttribute actual = MemberInfoExtensions.GetAttribute <MyTestAttribute>(t, false);

            Assert.IsNotNull(actual);
        }
Пример #2
0
        public void GetAttribute()
        {
            ParameterInfo   pi     = GetParameter();
            MyTestAttribute actual = ParameterInfoExtension.GetAttribute <MyTestAttribute>(pi);

            Assert.IsNotNull(actual);
        }
Пример #3
0
        public void GetAttribute_on_inherited_true()
        {
            Type            t      = typeof(MyDerivedTestClass);
            MyTestAttribute actual = MemberInfoExtensions.GetAttribute <MyTestAttribute>(t, true);

            Assert.IsNotNull(actual);
        }
Пример #4
0
    public override void OnGUI(UnityEngine.Rect position, SerializedProperty property, UnityEngine.GUIContent label)
    {
        MyTestAttribute attribute = (MyTestAttribute)base.attribute;

        property.intValue = Mathf.Min(Mathf.Max(EditorGUI.IntField(position, label.text, property.intValue), attribute.min), attribute.max);
    }