Пример #1
0
    void OnSequenceCompleted(PasswordLock sender)
    {
        if (sender != _passwordLock)
        {
            return;
        }

        PlaySecretSound();

        OnExitedLostSector();
    }
Пример #2
0
    void OnCorrectEntryAddedToSequence(PasswordLock sender, Object entry)
    {
        if (sender != _passwordLock)
        {
            return;
        }

        if (_passwordLock.RemainingEntriesNeeded == 1)
        {
            OnSequenceIsOneAwayFromCompleted();
        }
    }
Пример #3
0
    void InitPasswordLock()
    {
        List <LostSectorPortal> solutionPortals = new List <LostSectorPortal>();

        foreach (IndexDirection2.DirectionEnum d in _solution)
        {
            IndexDirection2  dir    = IndexDirection2.FromDirectionEnum(d);
            LostSectorPortal portal = DirectionToPortal(dir);
            solutionPortals.Add(portal);
        }
        _passwordLock = new PasswordLock(solutionPortals.ToArray());

        _passwordLock.CorrectEntryCallback           += OnCorrectEntryAddedToSequence;
        _passwordLock.IncorrectEntryCallback         += OnIncorrectEntryAddedToSequence;
        _passwordLock.CorrectPasswordEnteredCallback += OnSequenceCompleted;
    }
Пример #4
0
 void OnIncorrectEntryAddedToSequence(PasswordLock sender, Object entry)
 {
     OverrideSectorsWithThisSector(IndexDirection2.AllValidNonZeroDirections, true);
 }