/// <summary> /// 获取热更实体 /// </summary> /// <param name="entityId">实体编号</param> /// <returns>实体</returns> public HotEntityBase GetEntity(int entityId) { HotEntityBase hotfixEntity = null; if (m_EntityInfos.TryGetValue(entityId, out hotfixEntity)) { return(hotfixEntity); } return(null); }
/// <summary> /// 获取所有已加载的实体 /// </summary> /// <returns>所有已加载的实体</returns> public HotEntityBase[] GetAllLoadedEntities() { int index = 0; HotEntityBase[] results = new HotEntityBase[m_EntityInfos.Count]; foreach (KeyValuePair <int, HotEntityBase> entityInfo in m_EntityInfos) { results[index++] = entityInfo.Value; } return(results); }
/// <summary> /// 隐藏实体 /// </summary> /// <param name="entity">实体</param> public void HideEntity(HotEntityBase entity) { GameEntry.Entity.HideEntity(entity.Entity); }
/// <summary> /// 隐藏实体 /// </summary> /// <param name="entity">实体</param> /// <param name="userData">用户自定义数据</param> public void HideEntity(HotEntityBase entity, object userData) { GameEntry.Entity.HideEntity(entity.Entity, userData); }
/// <summary> /// 是否是合法的实体 /// </summary> /// <param name="entity">实体</param> /// <returns>实体是否合法</returns> public bool IsValidEntity(HotEntityBase entity) { return(GameEntry.Entity.IsValidEntity(entity.Entity)); }