public void ReplacePlanetViewFactory(PlanetViewFactory newValue) { var index = GameComponentsLookup.PlanetViewFactory; var component = (PlanetViewFactoryComponent)CreateComponent(index, typeof(PlanetViewFactoryComponent)); component.Value = newValue; ReplaceComponent(index, component); }
public GameEntity SetPlanetViewFactory(PlanetViewFactory newValue) { if (hasPlanetViewFactory) { throw new Entitas.EntitasException("Could not set PlanetViewFactory!\n" + this + " already has an entity with PlanetViewFactoryComponent!", "You should check if the context already has a planetViewFactoryEntity before setting it or use context.ReplacePlanetViewFactory()."); } var entity = CreateEntity(); entity.AddPlanetViewFactory(newValue); return(entity); }
public void ReplacePlanetViewFactory(PlanetViewFactory newValue) { var entity = planetViewFactoryEntity; if (entity == null) { entity = SetPlanetViewFactory(newValue); } else { entity.ReplacePlanetViewFactory(newValue); } }