Esempio n. 1
0
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
        System.Type genericType = fieldInfo.FieldType.GetGenericArguments()[0];

        if (genericType.IsSameAsOrSubclassOf(typeof(GameObject)) ||
            genericType.IsSameAsOrSubclassOf(typeof(Component)))
        {
            ReferenceDrawer.OnGUI(position, property, label, ReferenceDrawerType.Input,
                                  ReferenceDataType.GameObjectOrComponent);
        }
        else
        {
            ReferenceDrawer.OnGUI(position, property, label, ReferenceDrawerType.Input,
                                  ReferenceDataType.NeitherGameObjectNorComponent);
        }
    }
Esempio n. 2
0
    public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
    {
        System.Type genericType = fieldInfo.FieldType.GetGenericArguments()[0];

        if (genericType.IsSameAsOrSubclassOf(typeof(GameObject)) ||
            genericType.IsSameAsOrSubclassOf(typeof(Component)))
        {
            return(ReferenceDrawer.GetPropertyHeight(property, label, ReferenceDrawerType.Input,
                                                     ReferenceDataType.GameObjectOrComponent));
        }
        else
        {
            return(ReferenceDrawer.GetPropertyHeight(property, label, ReferenceDrawerType.Input,
                                                     ReferenceDataType.NeitherGameObjectNorComponent));
        }
    }
Esempio n. 3
0
 public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
 {
     ReferenceDrawer.OnGUI(position, property, label, ReferenceDrawerType.Result,
                           ReferenceDataType.NeitherGameObjectNorComponent);
 }
Esempio n. 4
0
 public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
 {
     return(ReferenceDrawer.GetPropertyHeight(property, label, ReferenceDrawerType.Result,
                                              ReferenceDataType.NeitherGameObjectNorComponent));
 }