protected override void DrawElementCallBack(Rect rect, int index, bool isActive, bool isFocused)
        {
            base.DrawElementCallBack(rect, index, isActive, isFocused);
            var prop      = property.GetArrayElementAtIndex(index);
            var graph     = prop.objectReferenceValue;
            var graphName = graph == null ? "empty" : graph.name;

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

            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);
            }
        }
        protected override void DrawElementCallBack(Rect rect, int index, bool isActive, bool isFocused)
        {
            base.DrawElementCallBack(rect, index, isActive, isFocused);
            var prop = property.GetArrayElementAtIndex(index);

            rect = BridgeEditorUtility.DrawBoxRect(rect, index.ToString("00"));
            EditorGUI.PropertyField(rect, prop);
        }
        protected override void DrawElementCallBack(Rect rect, int index, bool isActive, bool isFocused)
        {
            rect = BridgeEditorUtility.DrawBoxRect(rect, "");
            base.DrawElementCallBack(rect, index, isActive, isFocused);
            var        prop    = property.GetArrayElementAtIndex(index);
            GUIContent content = GUIContent.none;

            if (prop.objectReferenceValue != null)
            {
                var obj = (prop.objectReferenceValue as PopDataObj);
                content = new GUIContent(obj.descrition);
            }

            EditorGUI.PropertyField(rect, prop, content);
        }
示例#4
0
        protected override void DrawElementCallBack(Rect rect, int index, bool isActive, bool isFocused)
        {
            base.DrawElementCallBack(rect, index, isActive, isFocused);
            var prop      = property.GetArrayElementAtIndex(index);
            var graphGUID = prop.stringValue;

            BridgeUI.Graph.UIGraph graph = null;
            if (!string.IsNullOrEmpty(graphGUID))
            {
                var path = AssetDatabase.GUIDToAssetPath(graphGUID);
                if (!string.IsNullOrEmpty(path))
                {
                    graph = AssetDatabase.LoadAssetAtPath <Graph.UIGraph>(path);
                }
            }

            var graphName = graph == null ? "empty" : graph.name;

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

            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
            {
                var graphNew = EditorGUI.ObjectField(btnRect, graph, typeof(BridgeUI.Graph.UIGraph), false) as Graph.UIGraph;
                if (graphNew != null && graphNew != graph)
                {
                    SetProperyValue(prop, graphNew);
                }
            }
        }