private void SetDefinition(MouthDefinition definition) { _unmatchedTeeth = definition.Apply(_teeth).ToList(); foreach (ToothController tooth in _unmatchedTeeth) { tooth.RepetitionsCompleted.AddListener(OnToothMatched); } }
private void OnDefinitionFinished() { DefinitionMatched?.Invoke(); _definitionIndex++; if (_definitionIndex < _mouthDefinitions.Count) { MouthDefinition nextDefinition = _mouthDefinitions[_definitionIndex]; SetDefinition(nextDefinition); } else { AllDefinitionsMatched?.Invoke(); if (_disableOnFinish) { enabled = false; } } }