| | |
| | | public class SceneLoader |
| | | { |
| | | |
| | | public static GameObject LoadCreateRole(string name) |
| | | { |
| | | GameObject prefab = null; |
| | | if (AssetSource.sceneFromEditor) |
| | | { |
| | | #if UNITY_EDITOR |
| | | var path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, "Scene/CreateRole/", name, ".prefab"); |
| | | prefab = UnityEditor.AssetDatabase.LoadAssetAtPath<GameObject>(path); |
| | | #endif |
| | | } |
| | | else |
| | | { |
| | | var assetInfo = new AssetInfo("maps/createrole", name); |
| | | prefab = AssetBundleUtility.Instance.Sync_LoadAsset(assetInfo) as GameObject; |
| | | } |
| | | |
| | | if (prefab == null) |
| | | { |
| | | DebugEx.LogErrorFormat("SceneLoader.LoadCreateRole() => 加载不到资源: {0}.", name); |
| | | } |
| | | |
| | | return prefab; |
| | | } |
| | | |
| | | public static Texture2D LoadTexture(string folder, string name) |
| | | { |
| | | Texture2D texture2D = null; |