コード例 #1
0
        public static T DrawSelectionBox <T>(GUIContent content, List <SelectionBoxItems <T> > values, SelectionBoxItems <T> value)
        {
            GUILayout.BeginHorizontal();

            GUILayout.Label(content);

            if (GUILayout.Button("Selected Item : " + value.itemName, EditorStyles.objectField))
            {
                value       = SelectionBoxWindow.instance.Draw(values, value);
                GUI.changed = true;
            }
            else
            {
                if (SelectionBoxWindow.item != null)
                {
                    value       = SelectionBoxWindow.item as SelectionBoxItems <T>;
                    GUI.changed = true;
                }
            }

            GUILayout.EndHorizontal();

            return(value == null ? default(T) : value.item);
        }