public void ReplaceComboChecker(IComboChecker newComboChecker) { var index = GameComponentsLookup.ComboChecker; var component = CreateComponent <ComboCheckerComponent>(index); component.comboChecker = newComboChecker; ReplaceComponent(index, component); }
public GameEntity SetComboChecker(IComboChecker newComboChecker) { if (hasComboChecker) { throw new Entitas.EntitasException("Could not set ComboChecker!\n" + this + " already has an entity with ComboCheckerComponent!", "You should check if the context already has a comboCheckerEntity before setting it or use context.ReplaceComboChecker()."); } var entity = CreateEntity(); entity.AddComboChecker(newComboChecker); return(entity); }
public void ReplaceComboChecker(IComboChecker newComboChecker) { var entity = comboCheckerEntity; if (entity == null) { entity = SetComboChecker(newComboChecker); } else { entity.ReplaceComboChecker(newComboChecker); } }