Ejemplo n.º 1
0
    public void accept(AreaConnectionRelationship rel)
    {
        // Mark a connection between two areas here
        // The actual connections are built after all the relationships are added
        addArea(rel.firstAreaName);
        addArea(rel.secondAreaName);

        if (!rel.locked) {
            if (!_areaConnections[rel.firstAreaName].Contains(rel.secondAreaName))
                _areaConnections[rel.firstAreaName].Add(rel.secondAreaName);
        }
        else {
            // Handle locked connections.
            if (!_lockedAreaConnections[rel.firstAreaName].Contains(rel))
                _lockedAreaConnections[rel.firstAreaName].Add(rel);
            _itemNames.Add(rel.keyName);
        }
    }
Ejemplo n.º 2
0
    public void accept(AreaConnectionRelationship rel)
    {
        // Not dealing with these during runtime unless it's a locked door
        if (!rel.locked)
            throw new UnityException("AreaConnectionRelationship applied during game!");

        // Otherwise, destroy both our key and lock for now
        PlayState.instance.playAudio(PlayState.instance.lockClip);

        if (_item1.inInventory)
            _item1.currentSlot.removeItem();
        if (_item1.insideItem)
            _item1.removeFromOtherItem();
        _item1.die();
        if (_item2.inInventory)
            _item2.currentSlot.removeItem();
        if (_item2.insideItem)
            _item2.removeFromOtherItem();
        _item2.die();
    }