using DG.Tweening.Plugins.Core.PathCore; using System; using System.Collections; using System.Collections.Generic; using System.IO; using UnityEditor; using UnityEngine; namespace Ether { public static class ConstName { static readonly string[] scenePathSplit = { "/", ".unity" }; public static List SceneNameList { get { List list = new List(); var scenes = EditorBuildSettings.scenes; for (int i = 0; i < scenes.Length; i++) { string path = scenes[i].path; string[] splitPath = path.Split(scenePathSplit, System.StringSplitOptions.RemoveEmptyEntries); string sceneName = ""; if (splitPath.Length > 0) { sceneName = splitPath[splitPath.Length - 1]; } else { sceneName = "(Deleted Scene)"; } list.Add(sceneName); } return list; } } public static List AudioNameList { get { List temp = new List(); FileTools.FindAllFileInDirectory(Application.dataPath + "/Resources/Audio", temp, ".mp3", ".wav", ".ogg"); for (int i = 0; i < temp.Count; i++) { string[] tempPath = temp[i].Split("/Resources/Audio/"); temp[i] = tempPath[1].Split(".")[0]; } temp.Insert(0, ""); return temp; } } public static List AllFrameList { get { Type[] allFrameBase = CommonTools.GetChildTypes(typeof(FrameBase)); List names = new List(); names.Add(""); foreach (var type in allFrameBase) { if (type.Name.EndsWith("Base")) { continue; } names.Add(type.Name); } return names; } } } }