/// <summary> /// 从界面组移除界面。 /// </summary> /// <param name="uiForm">要移除的界面。</param> public void RemoveUIForm(IUIForm uiForm) { UIFormInfo uiFormInfo = GetUIFormInfo(uiForm); if (uiFormInfo == null) { throw new GXException(Utility.Text.Format("Can not find UI form info for serial id '{0}', UI form asset name is '{1}'.", uiForm.SerialId.ToString(), uiForm.UIFormAssetName)); } if (!uiFormInfo.Covered) { uiFormInfo.Covered = true; uiForm.OnCover(); } if (!uiFormInfo.Paused) { uiFormInfo.Paused = true; uiForm.OnPause(); } if (m_CachedNode != null && m_CachedNode.Value.UIForm == uiForm) { m_CachedNode = m_CachedNode.Next; } if (!m_UIFormInfos.Remove(uiFormInfo)) { throw new GXException(Utility.Text.Format("UI group '{0}' not exists specified UI form '[{1}]{2}'.", m_Name, uiForm.SerialId.ToString(), uiForm.UIFormAssetName)); } ReferencePool.Release(uiFormInfo); }
/// <summary> /// 任务管理器轮询。 /// </summary> /// <param name="elapseSeconds">逻辑流逝时间,以秒为单位。</param> /// <param name="realElapseSeconds">真实流逝时间,以秒为单位。</param> internal override void Update(float elapseSeconds, float realElapseSeconds) { LinkedListNode <TaskBase> current = m_Tasks.First; while (current != null) { TaskBase task = current.Value; if (task.Status == TaskStatus.Free) { throw new GXException("Task status is invalid."); } if (task.Status == TaskStatus.Waiting) { task.OnStart(); } if (task.Status == TaskStatus.Running) { task.OnUpdate(elapseSeconds, realElapseSeconds); current = current.Next; } else { LinkedListNode <TaskBase> next = current.Next; m_Tasks.Remove(current); ReferencePool.Release(task); current = next; } } }
/// <summary> /// 从实体组移除实体。 /// </summary> /// <param name="entity">要移除的实体。</param> public void RemoveEntity(IEntity entity) { if (m_CachedNode != null && m_CachedNode.Value == entity) { m_CachedNode = m_CachedNode.Next; } if (!m_Entities.Remove(entity)) { throw new GXException(Utility.Text.Format("Entity group '{0}' not exists specified entity '[{1}]{2}'.", m_Name, entity.Id.ToString(), entity.EntityAssetName)); } }