Esempio n. 1
0
        public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
        {
            if (NavigationDrawer.s_Styles == null)
            {
                NavigationDrawer.s_Styles = new NavigationDrawer.Styles();
            }
            Rect position = pos;

            position.height = EditorGUIUtility.singleLineHeight;
            SerializedProperty serializedProperty = prop.FindPropertyRelative("m_Mode");

            Navigation.Mode navigationMode = NavigationDrawer.GetNavigationMode(serializedProperty);
            EditorGUI.PropertyField(position, serializedProperty, NavigationDrawer.s_Styles.navigationContent);
            EditorGUI.indentLevel++;
            position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
            if (navigationMode == Navigation.Mode.Explicit)
            {
                SerializedProperty property  = prop.FindPropertyRelative("m_SelectOnUp");
                SerializedProperty property2 = prop.FindPropertyRelative("m_SelectOnDown");
                SerializedProperty property3 = prop.FindPropertyRelative("m_SelectOnLeft");
                SerializedProperty property4 = prop.FindPropertyRelative("m_SelectOnRight");
                EditorGUI.PropertyField(position, property);
                position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
                EditorGUI.PropertyField(position, property2);
                position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
                EditorGUI.PropertyField(position, property3);
                position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
                EditorGUI.PropertyField(position, property4);
                position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
            }
            EditorGUI.indentLevel--;
        }
 public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
 {
   if (NavigationDrawer.s_Styles == null)
     NavigationDrawer.s_Styles = new NavigationDrawer.Styles();
   Rect position = pos;
   position.height = EditorGUIUtility.singleLineHeight;
   SerializedProperty propertyRelative1 = prop.FindPropertyRelative("m_Mode");
   Navigation.Mode navigationMode = NavigationDrawer.GetNavigationMode(propertyRelative1);
   EditorGUI.PropertyField(position, propertyRelative1, NavigationDrawer.s_Styles.navigationContent);
   ++EditorGUI.indentLevel;
   position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
   if (navigationMode == Navigation.Mode.Explicit)
   {
     SerializedProperty propertyRelative2 = prop.FindPropertyRelative("m_SelectOnUp");
     SerializedProperty propertyRelative3 = prop.FindPropertyRelative("m_SelectOnDown");
     SerializedProperty propertyRelative4 = prop.FindPropertyRelative("m_SelectOnLeft");
     SerializedProperty propertyRelative5 = prop.FindPropertyRelative("m_SelectOnRight");
     EditorGUI.PropertyField(position, propertyRelative2);
     position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
     EditorGUI.PropertyField(position, propertyRelative3);
     position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
     EditorGUI.PropertyField(position, propertyRelative4);
     position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
     EditorGUI.PropertyField(position, propertyRelative5);
     position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
   }
   --EditorGUI.indentLevel;
 }