コード例 #1
0
    public void ReplaceBoard(Game.LevelBlueprint newValue)
    {
        var index     = GameComponentsLookup.Board;
        var component = CreateComponent <Game.BoardComponent>(index);

        component.value = newValue;
        ReplaceComponent(index, component);
    }
コード例 #2
0
    public GameEntity SetBoard(Game.LevelBlueprint newValue)
    {
        if (hasBoard)
        {
            throw new Entitas.EntitasException("Could not set Board!\n" + this + " already has an entity with Game.BoardComponent!",
                                               "You should check if the context already has a boardEntity before setting it or use context.ReplaceBoard().");
        }
        var entity = CreateEntity();

        entity.AddBoard(newValue);
        return(entity);
    }
コード例 #3
0
    public void ReplaceBoard(Game.LevelBlueprint newValue)
    {
        var entity = boardEntity;

        if (entity == null)
        {
            entity = SetBoard(newValue);
        }
        else
        {
            entity.ReplaceBoard(newValue);
        }
    }