Exemplo n.º 1
0
 /// <summary>EDITOR ONLY: Imports level assets from Assets/Levels.</summary>
 public void EDITOR_Import()
 {
     //get levels
     levels = FolderManager.GetAssetsAtPath <Level>("Levels");
     //save assets
     EditorUtility.SetDirty(this);
     AssetDatabase.SaveAssets();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Imports from folder.
        /// </summary>
        /// <param name="folder">Folder.</param>
        public void EDITOR_ImportFromFolder(string folder)
        {
            AudioClip[] clips = FolderManager.GetAssetsAtPath <AudioClip>("Audio/" + folder);
            audioFiles = new AudioFile[clips.Length];
            for (int i = 0; i < audioFiles.Length; i++)
            {
                audioFiles[i] = new AudioFile(clips[i]);
            }

            EditorUtility.SetDirty(this);
            AssetDatabase.SaveAssets();
        }
Exemplo n.º 3
0
        /// <summary>EDITOR ONLY: Imports an array of TextAssets from Assets/Localization</summary>
        public void EDITOR_Import()
        {
            //get all the json assets from Assets/Localization
            TextAsset[] assets = FolderManager.GetAssetsAtPath <TextAsset>("Localization");
            Assert.IsTrue(assets.Length > 0);

            //create a new array of supported langauges
            supportedLanguages = new SupportedLanguage[assets.Length];
            for (int i = 0; i < assets.Length; i++)
            {
                TextAsset      asset          = assets[i];
                SystemLanguage systemLanguage = (SystemLanguage)System.Enum.Parse(typeof(SystemLanguage), asset.name);
                supportedLanguages[i] = new SupportedLanguage(language: systemLanguage, jsonDatabase: asset);
            }
        }