protected override void DrawElementCallBack(Rect rect, int index, bool isActive, bool isFocused)
        {
            var prop = property.GetArrayElementAtIndex(index);

            rect = BridgeEditorUtility.DrawBoxRect(rect, index.ToString());
            EditorGUI.PropertyField(rect, prop);
        }
Beispiel #2
0
        protected override void DrawElementCallBack(Rect rect, int index, bool isActive, bool isFocused)
        {
            var prop      = property.GetArrayElementAtIndex(index);
            var graph     = prop.objectReferenceValue;
            var graphName = graph == null ? "empty" : graph.name;

            rect = BridgeEditorUtility.DrawBoxRect(rect, index.ToString());

            var btnRect = new Rect(rect.x, rect.y, rect.width - 30, EditorGUIUtility.singleLineHeight);

            if (GUI.Button(btnRect, graphName, EditorStyles.toolbarButton))
            {
                AssetDatabase.OpenAsset(graph);
            }

            btnRect = new Rect(rect.x + rect.width - 30, rect.y, 30, EditorGUIUtility.singleLineHeight);

            if (graph != null)
            {
                if (GUI.Button(btnRect, " ", EditorStyles.objectFieldMiniThumb))
                {
                    EditorGUIUtility.PingObject(graph);
                }
                DragGroupObj(btnRect, prop);
            }
            else
            {
                prop.objectReferenceValue = EditorGUI.ObjectField(btnRect, prop.objectReferenceValue, typeof(BridgeUI.Graph.UIGraph), false);
            }
        }