Exemplo n.º 1
0
    void ItemTable_Body()
    {
        EditorGUILayout.BeginVertical();

        for (int k = 0; k < _items.COUNT; k++)
        {
            if (_items.Item(k) != null)
            {
                EditorGUILayout.BeginHorizontal();

                if (GUILayout.Button(_items.Item(k).name, "Box", GUILayout.ExpandWidth(true)))
                {
                    _index = k;
                    EditorUtility.SetDirty(_items);
                }

                if (GUILayout.Button("-", GUILayout.Width(15.0f)))
                {
                    AssetDatabase.DeleteAsset("Assets/Resources/Items/" + _items.Item(k).name.ToString() + ".asset");
                    _items.RemoveAt(k);
                    EditorUtility.SetDirty(_items);
                }
                EditorGUILayout.EndHorizontal();
            }
        }

        EditorGUILayout.EndVertical();
    }