public void ReplaceMissionsDB(MissionsDB newValue) { var index = GameComponentsLookup.MissionsDB; var component = CreateComponent <MissionsDBComponent>(index); component.value = newValue; ReplaceComponent(index, component); }
public GameEntity SetMissionsDB(MissionsDB newValue) { if (hasMissionsDB) { throw new Entitas.EntitasException("Could not set MissionsDB!\n" + this + " already has an entity with MissionsDBComponent!", "You should check if the context already has a missionsDBEntity before setting it or use context.ReplaceMissionsDB()."); } var entity = CreateEntity(); entity.AddMissionsDB(newValue); return(entity); }
public void ReplaceMissionsDB(MissionsDB newValue) { var entity = missionsDBEntity; if (entity == null) { entity = SetMissionsDB(newValue); } else { entity.ReplaceMissionsDB(newValue); } }