少年修仙传客户端代码仓库
client_Zxw
2019-01-23 6e42b7d4f0370f9659aa397ff909aab477a3e676
Core/ResModule/ScriptableObjectLoader.cs
@@ -22,6 +22,7 @@
    public const string SoMapObjectGenerate_Suffix = "SoMapObjectGenerate_";
    public const string SoTreasureMeridian_Suffix = "SoTreasureMeridian_";
    public const string SoTreasure3D_Suffix = "SoTreasure3D_";
    public const string SoDemonDungeon_Suffix = "SoDemonDungeon_";
    public static SoMap LoadSoMapObjectGenerate(int mapID)
    {
@@ -47,7 +48,7 @@
        if (_config == null)
        {
            DesignDebug.LogErrorFormat("ScriptableObjectLoader.LoadSoActor() => 加载不到资源: {0}.", mapID);
            DebugEx.LogErrorFormat("ScriptableObjectLoader.LoadSoActor() => 加载不到资源: {0}.", mapID);
        }
        return _config;
@@ -79,7 +80,7 @@
        if (_config == null)
        {
            DesignDebug.LogErrorFormat("ScriptableObjectLoader.LoadSoActor() => 加载不到资源: {0}.", raceId);
            DebugEx.LogErrorFormat("ScriptableObjectLoader.LoadSoActor() => 加载不到资源: {0}.", raceId);
        }
        return _config;
@@ -426,4 +427,34 @@
        return config;
    }
    public static DemonDungeonScriptable LoadSoDemonDungeon(int _id)
    {
        DemonDungeonScriptable config = null;
        if (AssetSource.refdataFromEditor)
        {
#if UNITY_EDITOR
            var resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
                                                   "Refdata/ScriptableObject/SoDemonDungeon/",
                                                   SoDemonDungeon_Suffix,
                                                   _id,
                                                   ".asset");
            config = AssetDatabase.LoadAssetAtPath<DemonDungeonScriptable>(resourcePath);
#endif
        }
        else
        {
            var assetName = StringUtility.Contact(SoDemonDungeon_Suffix, _id);
            var assetInfo = new AssetInfo(bundleName, assetName);
            config = AssetBundleUtility.Instance.Sync_LoadAsset(assetInfo) as DemonDungeonScriptable;
        }
        if (config == null)
        {
            //Debug.LogErrorFormat("ScriptableObjectLoader.TreasureMeridianConfig() => 加载不到资源: {0}.", _id);
        }
        return config;
    }
}