コード例 #1
0
    void InstansiateKanji()
    {
        GUI.FocusControl(null);
        if (kanjiLibrary.ContainsID(uuid))
        {
            Debug.Log("uuid already exists!");
            return;
        }
        Kanji c = Editor.CreateInstance <Kanji>();

        c.name      = uuid;
        c.uuid      = uuid;
        c.entryName = uuid;
        c.repColor  = repColor;
        string path = "Assets/LibraryData/Kanji/" + uuid + ".asset";

        AssetDatabase.CreateAsset(c, path);
        kanjiLibrary.InsertEntry(c, 0);
        Undo.RecordObject(kanjiLibrary, "Added kanji");
        EditorUtility.SetDirty(kanjiLibrary);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        uuid     = "";
        selKanji = 0;
        SelectKanji();
    }
コード例 #2
0
    protected void InstansiateEntry()
    {
        GUI.FocusControl(null);
        if (!IsValidUuid(uuid))
        {
            return;
        }
        ScrObjLibraryEntry entry = CreateInstance;

        entry.name      = uuid;
        entry.uuid      = uuid;
        entry.repColor  = repColor;
        entry.entryName = uuid;
        string path = "Assets/LibraryData/" + NameString + "/" + NameString + "_" + uuid + ".asset";

        entryLibrary.InsertEntry(entry, 0);
        Undo.RecordObject(entryLibrary, "Added entry");
        EditorUtility.SetDirty(entryLibrary);
        AssetDatabase.CreateAsset(entry, path);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        uuid     = "";
        selIndex = 0;
        SelectEntry();
        RefreshEntryList();
    }
コード例 #3
0
    public void InstansiateDialogue()
    {
        GUI.FocusControl(null);
        if (dialogueLibrary.ContainsID(dialogueUuid))
        {
            Debug.Log("uuid already exists!");
            return;
        }
        DialogueEntry de = Editor.CreateInstance <DialogueEntry>();

        de.name      = dialogueUuid;
        de.uuid      = dialogueUuid;
        de.entryName = dialogueUuid;
        de.repColor  = repColor;
        de.CreateBasicActions();
        string path = "Assets/LibraryData/Dialogues/" + dialogueUuid + ".asset";

        dialogueLibrary.InsertEntry(de, 0);
        Undo.RecordObject(dialogueLibrary, "Added dialogue");
        EditorUtility.SetDirty(dialogueLibrary);
        AssetDatabase.CreateAsset(de, path);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        dialogueUuid = "";
        selDialogue  = 0;
        SelectDialogue();
    }
コード例 #4
0
    void InstansiateSfx()
    {
        GUI.FocusControl(null);
        if (sfxLibrary.ContainsID(uuid))
        {
            Debug.Log("uuid already exists!");
            return;
        }
        SfxList se = Editor.CreateInstance <SfxList>();

        se.name      = uuid;
        se.uuid      = uuid;
        se.entryName = uuid;
        se.repColor  = repColor;
        string path = "Assets/LibraryData/Songlists/" + uuid + ".asset";

        AssetDatabase.CreateAsset(se, path);
        sfxLibrary.InsertEntry(se, 0);
        Undo.RecordObject(sfxLibrary, "Added sfx");
        EditorUtility.SetDirty(sfxLibrary);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        currentEntryList = sfxLibrary.GetRepresentations("", filterStr);
        uuid             = "";
        selMusic         = 0;
        SelectMusic();
    }
コード例 #5
0
    void InstansiateEnemy()
    {
        GUI.FocusControl(null);
        if (enemyLibrary.ContainsID(enemyUuid))
        {
            Debug.Log("uuid already exists!");
            return;
        }
        EnemyEntry ee = Editor.CreateInstance <EnemyEntry>();

        ee.name      = enemyUuid;
        ee.uuid      = enemyUuid;
        ee.entryName = enemyUuid;
        ee.repColor  = repColor;
        string path = "Assets/LibraryData/Enemies/" + enemyUuid + ".asset";

        enemyLibrary.InsertEntry(ee, 0);
        Undo.RecordObject(enemyLibrary, "Added enemy");
        EditorUtility.SetDirty(enemyLibrary);
        AssetDatabase.CreateAsset(ee, path);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        currentEntryList = enemyLibrary.GetRepresentations("", filterStr);
        enemyUuid        = "";
        selEnemy         = 0;
        SelectEnemy();
    }
コード例 #6
0
    void InstansiateMusic()
    {
        GUI.FocusControl(null);
        if (musicLibrary.ContainsID(uuid))
        {
            Debug.Log("uuid already exists!");
            return;
        }
        MusicEntry me = Editor.CreateInstance <MusicEntry>();

        me.name      = uuid;
        me.uuid      = uuid;
        me.entryName = uuid;
        me.repColor  = repColor;
        string path = "Assets/LibraryData/Music/" + uuid + ".asset";

        AssetDatabase.CreateAsset(me, path);
        musicLibrary.InsertEntry(me, 0);
        Undo.RecordObject(musicLibrary, "Added music");
        EditorUtility.SetDirty(musicLibrary);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        uuid     = "";
        selMusic = 0;
        SelectMusic();
    }
コード例 #7
0
    void InstansiateBackground()
    {
        GUI.FocusControl(null);
        if (backgroundLibrary.ContainsID(uuid))
        {
            Debug.Log("uuid already exists!");
            return;
        }
        BackgroundEntry bke = Editor.CreateInstance <BackgroundEntry>();

        bke.name      = uuid;
        bke.uuid      = uuid;
        bke.entryName = uuid;
        bke.repColor  = repColor;
        string path = "Assets/LibraryData/Backgrounds/" + uuid + ".asset";

        AssetDatabase.CreateAsset(bke, path);
        backgroundLibrary.InsertEntry(bke, 0);
        Undo.RecordObject(backgroundLibrary, "Added background");
        EditorUtility.SetDirty(backgroundLibrary);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        currentEntryList = backgroundLibrary.GetRepresentations("", filterStr);
        uuid             = "";
        selBackground    = 0;
        SelectBackground();
    }
コード例 #8
0
    void InstansiateModule()
    {
        GUI.FocusControl(null);
        if (moduleLibrary.ContainsID(uuid))
        {
            Debug.Log("uuid already exists!");
            return;
        }
        Module c = Editor.CreateInstance <Module>();

        c.name      = uuid;
        c.uuid      = uuid;
        c.entryName = uuid;
        c.repColor  = repColor;
        string path = "Assets/LibraryData/Modules/" + uuid + ".asset";

        AssetDatabase.CreateAsset(c, path);
        moduleLibrary.InsertEntry(c, 0);
        Undo.RecordObject(moduleLibrary, "Added module");
        EditorUtility.SetDirty(moduleLibrary);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        currentEntryList = moduleLibrary.GetRepresentations("", filterStr);
        uuid             = "";
        selModule        = 0;
        SelectModule();
    }
コード例 #9
0
    void InstansiateBattle()
    {
        GUI.FocusControl(null);
        if (battleLibrary.ContainsID(battleUuid))
        {
            Debug.Log("uuid already exists!");
            return;
        }
        BattleEntry be = Editor.CreateInstance <BattleEntry>();

        be.name      = battleUuid;
        be.uuid      = battleUuid;
        be.entryName = battleUuid;
        string path = "Assets/LibraryData/Battles/" + battleUuid + ".asset";

        battleLibrary.InsertEntry(be, 0);
        Undo.RecordObject(battleLibrary, "Added battle");
        EditorUtility.SetDirty(battleLibrary);
        AssetDatabase.CreateAsset(be, path);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        battleUuid = "";
        selBattle  = 0;
        SelectBattle();
    }
コード例 #10
0
    void InstansiateItem()
    {
        GUI.FocusControl(null);
        if (itemLibrary.ContainsID(uuid))
        {
            Debug.Log("uuid already exists!");
            return;
        }
        ItemEquip c = Editor.CreateInstance <ItemEquip>();

        c.name      = uuid;
        c.uuid      = uuid;
        c.entryName = uuid;
        c.repColor  = repColor;
        string path = "Assets/LibraryData/Items/" + uuid + ".asset";

        AssetDatabase.CreateAsset(c, path);
        itemLibrary.InsertEntry(c, 0);
        Undo.RecordObject(itemLibrary, "Added item");
        EditorUtility.SetDirty(itemLibrary);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        uuid    = "";
        selItem = 0;
        SelectItem();
    }
コード例 #11
0
    void InstansiateCharacter()
    {
        GUI.FocusControl(null);
        if (characterLibrary.ContainsID(uuid))
        {
            Debug.Log("uuid already exists!");
            return;
        }
        CharacterEntry c = Editor.CreateInstance <CharacterEntry>();

        c.name      = uuid;
        c.uuid      = uuid;
        c.entryName = uuid;
        c.repColor  = repColor;
        string path = "Assets/LibraryData/Characters/" + uuid + ".asset";

        AssetDatabase.CreateAsset(c, path);
        characterLibrary.InsertEntry(c, 0);
        Undo.RecordObject(characterLibrary, "Added character");
        EditorUtility.SetDirty(characterLibrary);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();

        uuid         = "";
        selCharacter = 0;
        SelectCharacter();
    }