Esempio n. 1
0
        public static void CreateModule <T>(string moduleName, System.Action <T> onCreate) where T : Component
        {
            PathUtils.CreatePath("AssistLib", "Resources", "Modules");
            var moduleDBEntry = AssetDBUtils.CreateScriptableObject <ModuleDBEntry>(PathUtils.Combine("Assets", "AssistLib", "Resources", "Modules"), moduleName);

            AssetDBUtils.CreatePrefab(moduleDBEntry, onCreate);
            ItemsEditor.CollectItems();
        }
Esempio n. 2
0
    public static void CreateItem <T>(string name) where T : ScriptableObject
    {
        var path = GetSelectedPath();

        var item = AssetDBUtils.CreateScriptableObject <T>(path, name);

        CollectItems();

        Selection.activeObject = item;
    }
Esempio n. 3
0
    public static void CreateDB()
    {
        if (DB.Get <DB>() != null)
        {
            return;
        }

        PathUtils.CreatePath("Resources");
        AssetDBUtils.CreateScriptableObject <DB>(PathUtils.Combine("Assets", "Resources"), "DB");
        CollectItems();
    }
        private void StoreLocalization(Dictionary <string, Dictionary <string, string> > localization)
        {
            foreach (KeyValuePair <string, Dictionary <string, string> > kvp in localization)
            {
                var lang = DB.Get <LanguageItem>(kvp.Key);
                if (lang == null)
                {
                    lang = AssetDBUtils.CreateScriptableObject <LanguageItem>(PathUtils.Combine("Assets", "Localization", "Resources", "Languages"), kvp.Key);
                }
                var json = JSONUtuls.Serialize(kvp.Value).DecodeEncodedNonAscii();
                FileUtils.SaveTextToFile(PathUtils.Combine(Application.dataPath, "Localization", "Resources", "Languages", kvp.Key + "@text.txt"), json);
            }

            Debug.Log(JSONUtuls.Serialize(localization).DecodeEncodedNonAscii());
        }
Esempio n. 5
0
    public static void CreateAppSettings()
    {
        if (DB.Get <DB>() == null)
        {
            return;
        }

        if (DB.Get <AppSettings>() != null)
        {
            return;
        }

        PathUtils.CreatePath("AssistLib", "Resources");
        AssetDBUtils.CreateScriptableObject <AppSettings>(PathUtils.Combine("Assets", "AssistLib", "Resources"), "AppSettings");
        CollectItems();
    }