Beispiel #1
0
        /// <summary>
        /// 获取actor的agent
        /// </summary>
        /// <param name="refAssemblyType">获取agent的Assembly,热更过程中执行的代码可能来自不同的Assembly,需要返回对应Assembly的对象才行</param>
        /// <returns></returns>
        internal IComponentActorAgent GetAgent(Type refAssemblyType = null)
        {
            if (cacheAgent != null && !HotfixMgr.DoingHotfix)
            {
                return(cacheAgent);
            }
            var agent = HotfixMgr.GetAgent <IComponentActorAgent>(this, refAssemblyType);

            if (!HotfixMgr.DoingHotfix)
            {
                cacheAgent = agent;
            }
            return(agent);
        }
Beispiel #2
0
 ///<summary>清除缓存的agent(热更时)</summary>
 public void ClearCacheAgent()
 {
     cacheAgent = null;
     driver.ClearAllCompsAgent();
 }