UnityEngine.GUITargetAttribute.GetGUITargetAttrValue C# (CSharp) Method

GetGUITargetAttrValue() private method

private GetGUITargetAttrValue ( System klass, string methodName ) : int
klass System
methodName string
return int
        private static int GetGUITargetAttrValue(System.Type klass, string methodName)
        {
            MethodInfo method = klass.GetMethod(methodName, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
            if (method != null)
            {
                object[] customAttributes = method.GetCustomAttributes(true);
                if (customAttributes != null)
                {
                    for (int i = 0; i < customAttributes.Length; i++)
                    {
                        if (customAttributes[i].GetType() == typeof(GUITargetAttribute))
                        {
                            GUITargetAttribute attribute = customAttributes[i] as GUITargetAttribute;
                            return attribute.displayMask;
                        }
                    }
                }
            }
            return -1;
        }
    }