Exemple #1
0
    public void ReplaceEndGameBehaviour(EndGameBehaviour newValue)
    {
        var index     = GameComponentsLookup.EndGameBehaviour;
        var component = CreateComponent <EndGameBehaviourComponent>(index);

        component.value = newValue;
        ReplaceComponent(index, component);
    }
Exemple #2
0
    public GameEntity SetEndGameBehaviour(EndGameBehaviour newValue)
    {
        if (hasEndGameBehaviour)
        {
            throw new Entitas.EntitasException("Could not set EndGameBehaviour!\n" + this + " already has an entity with EndGameBehaviourComponent!",
                                               "You should check if the context already has a endGameBehaviourEntity before setting it or use context.ReplaceEndGameBehaviour().");
        }
        var entity = CreateEntity();

        entity.AddEndGameBehaviour(newValue);
        return(entity);
    }
Exemple #3
0
    public void ReplaceEndGameBehaviour(EndGameBehaviour newValue)
    {
        var entity = endGameBehaviourEntity;

        if (entity == null)
        {
            entity = SetEndGameBehaviour(newValue);
        }
        else
        {
            entity.ReplaceEndGameBehaviour(newValue);
        }
    }