三国卡牌客户端基础资源仓库
hch
8 小时以前 0a840e0a483327f8522e60349f5fc848ff4d88a0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace HybridCLR.Editor.Meta
{
    public abstract class AssemblyResolverBase : IAssemblyResolver
    {
        public string ResolveAssembly(string assemblyName, bool throwExIfNotFind)
        {
            if (TryResolveAssembly(assemblyName, out string assemblyPath))
            {
                return assemblyPath;
            }
            if (throwExIfNotFind)
            {
                if (SettingsUtil.HotUpdateAssemblyNamesIncludePreserved.Contains(assemblyName))
                {
                    throw new Exception($"resolve Hot update dll:{assemblyName} failed! Please make sure that this hot update dll exists or the search path is configured in the external hot update path.");
                }
                else
                {
                    throw new Exception($"resolve AOT dll:{assemblyName} failed! Please make sure that the AOT project has referenced the dll and generated the trimmed AOT dll correctly.");
                }
            }
            return null;
        }
 
        protected abstract bool TryResolveAssembly(string assemblyName, out string assemblyPath);
    }
}