Ejemplo n.º 1
0
    public void Init(string dllName)
    {
        if (!Load(dllName))
        {
            UnityEngine.Debug.LogError("script dll load err");
            return;
        }
        Main main = Tool.Main();

        if (main != null)
        {
            m_Assembly.AllowUnboundCLRMethod = main.m_CheckUnBoundClass;
            UnityEngine.Debug.Log("CSHotFix 检测是否绑定类:" + main.m_CheckUnBoundClass);
        }
#if CSHotFixSafe
#else
        InitScript(m_Assembly);

#if CSHotFix
        CSHotFix.Runtime.Generated.CLRBindings.Initialize(m_Assembly);
        CSHotFix.Runtime.Generated.CLRBindings2.Initialize(m_Assembly);
#endif
#endif
        string HotFixLoop = dllName + ".HotFixLoop";
        m_HotFixDll = m_Assembly.Instantiate <IGameHotFixInterface>(HotFixLoop);
        m_HotFixDll.Start();
    }