コード例 #1
0
    public void ReplaceComboChecker(IComboChecker newComboChecker)
    {
        var index     = GameComponentsLookup.ComboChecker;
        var component = CreateComponent <ComboCheckerComponent>(index);

        component.comboChecker = newComboChecker;
        ReplaceComponent(index, component);
    }
コード例 #2
0
    public GameEntity SetComboChecker(IComboChecker newComboChecker)
    {
        if (hasComboChecker)
        {
            throw new Entitas.EntitasException("Could not set ComboChecker!\n" + this + " already has an entity with ComboCheckerComponent!",
                                               "You should check if the context already has a comboCheckerEntity before setting it or use context.ReplaceComboChecker().");
        }
        var entity = CreateEntity();

        entity.AddComboChecker(newComboChecker);
        return(entity);
    }
コード例 #3
0
    public void ReplaceComboChecker(IComboChecker newComboChecker)
    {
        var entity = comboCheckerEntity;

        if (entity == null)
        {
            entity = SetComboChecker(newComboChecker);
        }
        else
        {
            entity.ReplaceComboChecker(newComboChecker);
        }
    }