| | |
| | | public static Sprite LoadSprite(string name) |
| | | { |
| | | Sprite sprite = null; |
| | | if (AssetSource.builtInFromEditor) |
| | | if (!AssetSource.isUseAssetBundle) |
| | | { |
| | | #if UNITY_EDITOR |
| | | if (excludePngs.Contains(StringUtility.Contact(name, SPRITE_EXTENSION))) |
| | | { |
| | | var path = StringUtility.Contact("Assets/ResourcesOut/BuiltIn/Sprites/", name, SPRITE_EXTENSION); |
| | | path = System.Text.RegularExpressions.Regex.Replace(path, @"[\p{C}]", ""); |
| | | sprite = UnityEditor.AssetDatabase.LoadAssetAtPath<Sprite>(path); |
| | | } |
| | | else |
| | |
| | | public static GameObject LoadPrefab(string name) |
| | | { |
| | | GameObject prefab = null; |
| | | if (AssetSource.builtInFromEditor) |
| | | if (!AssetSource.isUseAssetBundle) |
| | | { |
| | | #if UNITY_EDITOR |
| | | var path = StringUtility.Contact("Assets/ResourcesOut/BuiltIn/Prefabs/", name, PREFAB_EXTENSION); |
| | |
| | | |
| | | public static void UnLoadPrefab(string name) |
| | | { |
| | | if (!AssetSource.builtInFromEditor) |
| | | if (AssetSource.isUseAssetBundle) |
| | | { |
| | | AssetBundleUtility.Instance.UnloadAsset("builtin/prefabs", name); |
| | | } |
| | |
| | | public static AudioClip LoadMusic(string name) |
| | | { |
| | | AudioClip audioClip = null; |
| | | if (AssetSource.builtInFromEditor) |
| | | if (!AssetSource.isUseAssetBundle) |
| | | { |
| | | #if UNITY_EDITOR |
| | | var path = StringUtility.Contact("Assets/ResourcesOut/BuiltIn/Musics/", name, AUDIO_EXTENSION); |
| | |
| | | public static AnimationClip LoadAnimationClip(string name) |
| | | { |
| | | AnimationClip clip = null; |
| | | if (AssetSource.builtInFromEditor) |
| | | if (!AssetSource.isUseAssetBundle) |
| | | { |
| | | #if UNITY_EDITOR |
| | | var path = StringUtility.Contact("Assets/ResourcesOut/BuiltIn/AnimationClips/", name, ".anim"); |
| | |
| | | public static Material LoadMaterial(string name) |
| | | { |
| | | Material material = null; |
| | | if (AssetSource.builtInFromEditor) |
| | | if (!AssetSource.isUseAssetBundle) |
| | | { |
| | | #if UNITY_EDITOR |
| | | var path = StringUtility.Contact("Assets/ResourcesOut/BuiltIn/Materials/", name, ".mat"); |
| | |
| | | { |
| | | |
| | | T config = null; |
| | | if (AssetSource.builtInFromEditor) |
| | | if (!AssetSource.isUseAssetBundle) |
| | | { |
| | | #if UNITY_EDITOR |
| | | var resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, |
| | |
| | | public static Font LoadFont(string fontName) |
| | | { |
| | | Font font = null; |
| | | if (AssetSource.builtInFromEditor) |
| | | if (!AssetSource.isUseAssetBundle) |
| | | { |
| | | #if UNITY_EDITOR |
| | | var path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, |