예제 #1
0
 private void CheckCompletion()
 {
     if (_requiredReceivers.TrueForAll(x => x.ReceivingStatus == true))
     {
         _doneButton.Activate();
     }
     else
     {
         _doneButton.Deactivate();
     }
 }
예제 #2
0
    private void OnLevelWasLoaded(int level)
    {
        _scoreDisplay = FindObjectOfType <ScoreDisplay>();
        _doneButton   = FindObjectOfType <DoneButton>();

        _requiredReceivers.Clear();
        _requiredReceivers.AddRange(FindObjectsOfType <SignalReceiver>());
        foreach (var receiver in _requiredReceivers)
        {
            receiver.OnReceiveStatusChanged.AddListener(CheckCompletion);
        }

        _levelCompleteScreen = FindObjectOfType <LevelCompleteScreen>();

        _scoreDisplay.SetLevelTitle(ActiveLevelId, _activeLevel.sceneTitle);

        _doneButton.Deactivate();
    }