示例#1
0
    public void ReplacePlanetViewFactory(PlanetViewFactory newValue)
    {
        var index     = GameComponentsLookup.PlanetViewFactory;
        var component = (PlanetViewFactoryComponent)CreateComponent(index, typeof(PlanetViewFactoryComponent));

        component.Value = newValue;
        ReplaceComponent(index, component);
    }
示例#2
0
    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);
    }
示例#3
0
    public void ReplacePlanetViewFactory(PlanetViewFactory newValue)
    {
        var entity = planetViewFactoryEntity;

        if (entity == null)
        {
            entity = SetPlanetViewFactory(newValue);
        }
        else
        {
            entity.ReplacePlanetViewFactory(newValue);
        }
    }