protected void DeleteEntry()
    {
        GUI.FocusControl(null);
        ScrObjLibraryEntry entry = entryLibrary.GetEntryByIndex(selIndex);
        string             path  = "Assets/LibraryData/" + NameString + "/" + NameString + "_" + entry.uuid + ".asset";

        entryLibrary.RemoveEntryByIndex(selIndex);
        Undo.RecordObject(entryLibrary, "Deleted entry");
        EditorUtility.SetDirty(entryLibrary);
        bool res = AssetDatabase.MoveAssetToTrash(path);

        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        if (res)
        {
            Debug.Log("Removed entry: " + entry.uuid);
            selIndex = -1;
        }
        else
        {
            Debug.LogError("Failed to remove entry: " + path);
        }
        RefreshEntryList();
    }
Ejemplo n.º 2
0
    void DeleteMusic()
    {
        GUI.FocusControl(null);
        MusicEntry me   = (MusicEntry)musicLibrary.GetEntryByIndex(selMusic);
        string     path = "Assets/LibraryData/Music/" + me.uuid + ".asset";

        musicLibrary.RemoveEntryByIndex(selMusic);
        Undo.RecordObject(musicLibrary, "Deleted music");
        EditorUtility.SetDirty(musicLibrary);
        bool res = AssetDatabase.MoveAssetToTrash(path);

        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        if (res)
        {
            Debug.Log("Removed music: " + me.uuid);
            selMusic = -1;
        }
    }
    void DeleteKanji()
    {
        GUI.FocusControl(null);
        Kanji  c    = (Kanji)kanjiLibrary.GetEntryByIndex(selKanji);
        string path = "Assets/LibraryData/Kanji/" + c.uuid + ".asset";

        kanjiLibrary.RemoveEntryByIndex(selKanji);
        Undo.RecordObject(kanjiLibrary, "Deleted kanji");
        EditorUtility.SetDirty(kanjiLibrary);
        bool res = AssetDatabase.MoveAssetToTrash(path);

        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        if (res)
        {
            Debug.Log("Removed kanji: " + c.uuid);
            selKanji = -1;
        }
    }
Ejemplo n.º 4
0
    public void DeleteDialogue()
    {
        GUI.FocusControl(null);
        DialogueEntry de   = (DialogueEntry)dialogueLibrary.GetEntryByIndex(selDialogue);
        string        path = "Assets/LibraryData/Dialogues/" + de.uuid + ".asset";

        dialogueLibrary.RemoveEntryByIndex(selDialogue);
        Undo.RecordObject(dialogueLibrary, "Deleted dialogue");
        EditorUtility.SetDirty(dialogueLibrary);
        bool res = AssetDatabase.MoveAssetToTrash(path);

        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        if (res)
        {
            Debug.Log("Removed dialogue: " + de.uuid);
            selDialogue = -1;
        }
    }
Ejemplo n.º 5
0
    void DeleteBackground()
    {
        GUI.FocusControl(null);
        BackgroundEntry bke  = (BackgroundEntry)backgroundLibrary.GetEntryByIndex(selBackground);
        string          path = "Assets/LibraryData/Backgrounds/" + bke.uuid + ".asset";

        backgroundLibrary.RemoveEntryByIndex(selBackground);
        Undo.RecordObject(backgroundLibrary, "Deleted background");
        EditorUtility.SetDirty(backgroundLibrary);
        bool res = AssetDatabase.MoveAssetToTrash(path);

        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        if (res)
        {
            Debug.Log("Removed background: " + bke.uuid);
            selBackground = -1;
        }
    }
Ejemplo n.º 6
0
    void DeleteEnemy()
    {
        GUI.FocusControl(null);
        EnemyEntry ee   = (EnemyEntry)enemyLibrary.GetEntryByIndex(selEnemy);
        string     path = "Assets/LibraryData/Enemies/" + ee.uuid + ".asset";

        enemyLibrary.RemoveEntryByIndex(selEnemy);
        Undo.RecordObject(enemyLibrary, "Deleted enemy");
        EditorUtility.SetDirty(enemyLibrary);
        bool res = AssetDatabase.MoveAssetToTrash(path);

        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        if (res)
        {
            Debug.Log("Removed enemy: " + ee.uuid);
            selEnemy = -1;
        }
    }
Ejemplo n.º 7
0
    void DeleteItem()
    {
        GUI.FocusControl(null);
        ItemEquip c    = (ItemEquip)itemLibrary.GetEntryByIndex(selItem);
        string    path = "Assets/LibraryData/Items/" + c.uuid + ".asset";

        itemLibrary.RemoveEntryByIndex(selItem);
        Undo.RecordObject(itemLibrary, "Deleted item");
        EditorUtility.SetDirty(itemLibrary);
        bool res = AssetDatabase.MoveAssetToTrash(path);

        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        if (res)
        {
            Debug.Log("Removed item: " + c.uuid);
            selItem = -1;
        }
    }
Ejemplo n.º 8
0
    void DeleteCharacter()
    {
        GUI.FocusControl(null);
        CharacterEntry c    = (CharacterEntry)characterLibrary.GetEntryByIndex(selCharacter);
        string         path = "Assets/LibraryData/Characters/" + c.uuid + ".asset";

        characterLibrary.RemoveEntryByIndex(selCharacter);
        Undo.RecordObject(characterLibrary, "Deleted character");
        EditorUtility.SetDirty(characterLibrary);
        bool res = AssetDatabase.MoveAssetToTrash(path);

        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        if (res)
        {
            Debug.Log("Removed character: " + c.uuid);
            selCharacter = -1;
        }
    }
    void DeleteSfx()
    {
        GUI.FocusControl(null);
        SfxList se   = (SfxList)sfxLibrary.GetEntryByIndex(selMusic);
        string  path = "Assets/LibraryData/Songlists/" + se.uuid + ".asset";

        sfxLibrary.RemoveEntryByIndex(selMusic);
        Undo.RecordObject(sfxLibrary, "Deleted sfx list");
        EditorUtility.SetDirty(sfxLibrary);
        bool res = AssetDatabase.MoveAssetToTrash(path);

        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        currentEntryList = sfxLibrary.GetRepresentations("", filterStr);

        if (res)
        {
            Debug.Log("Removed sfx: " + se.uuid);
            selMusic = -1;
        }
    }
Ejemplo n.º 10
0
    void DeleteModule()
    {
        GUI.FocusControl(null);
        Module c    = (Module)moduleLibrary.GetEntryByIndex(selModule);
        string path = "Assets/LibraryData/Modules/" + c.uuid + ".asset";

        moduleLibrary.RemoveEntryByIndex(selModule);
        Undo.RecordObject(moduleLibrary, "Deleted module");
        EditorUtility.SetDirty(moduleLibrary);
        bool res = AssetDatabase.MoveAssetToTrash(path);

        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        currentEntryList = moduleLibrary.GetRepresentations("", filterStr);

        if (res)
        {
            Debug.Log("Removed module: " + c.uuid);
            selModule = -1;
        }
    }