예제 #1
0
파일: HotEntity.cs 프로젝트: 542767059/ABC
        protected internal override void OnShow(object userData)
        {
            base.OnShow(userData);

            m_Data = (HotfixEntityData)userData;
            m_OnShow.Invoke(m_Data.UserData);
        }
예제 #2
0
파일: HotEntity.cs 프로젝트: 542767059/ABC
        protected override void OnInit(object userData)
        {
            base.OnInit(userData);

            m_Data = (HotfixEntityData)userData;
            m_HotfixEntityFullName = m_Data.HotfixEntityName;

            Debug.Log(m_HotfixEntityFullName);
            //获取热更新层的实例
            IType  type           = GameEntry.ILRuntime.AppDomain.LoadedTypes[m_HotfixEntityFullName];
            object hotfixInstance = ((ILType)type).Instantiate();

            //获取热更新层的方法并缓存
            m_OnShow       = new ILInstanceMethod(hotfixInstance, m_HotfixEntityFullName, "OnShow", 1);
            m_OnHide       = new ILInstanceMethod(hotfixInstance, m_HotfixEntityFullName, "OnHide", 1);
            m_OnAttached   = new ILInstanceMethod(hotfixInstance, m_HotfixEntityFullName, "OnAttached", 3);
            m_OnDetached   = new ILInstanceMethod(hotfixInstance, m_HotfixEntityFullName, "OnDetached", 2);
            m_OnAttachTo   = new ILInstanceMethod(hotfixInstance, m_HotfixEntityFullName, "OnAttachTo", 3);
            m_OnDetachFrom = new ILInstanceMethod(hotfixInstance, m_HotfixEntityFullName, "OnDetachFrom", 2);
            m_OnUpdate     = new ILInstanceMethod(hotfixInstance, m_HotfixEntityFullName, "OnUpdate", 2);

            //调用热更新层的OnInit
            GameEntry.ILRuntime.AppDomain.Invoke(m_HotfixEntityFullName, "OnInit", hotfixInstance, this, m_Data.UserData);
        }