void OnPlayerInput(object sender, PuzzleEventArgs args) { if (args.playerInput == password && comboType == ComboType.Safe) { locked = false; anim.SetTrigger("Open"); gameObject.layer = 2; unlockSound.Play(); } else if (args.playerInput == password && comboType == ComboType.Keypad) { if (target.tag == "Door") { target.GetComponent <Door>().Unlock(); } unlockSound.Play(); } }
public void OnPuzzleCompleted(object sender, PuzzleEventArgs e) { List <string> wordList = new List <string>(); Node currentNode = e.Node; while (!currentNode.IsStartNode) { wordList.Add(currentNode.Word); currentNode = currentNode.ParentNode; } wordList.Add(currentNode.Word); wordList.Reverse(); int wordNo = 1; foreach (var w in wordList) { Console.WriteLine($"{wordNo++}: {w}"); } _fileUtility.ResultsToFile(_outputPath, wordList); }
public void FireCompleteEvent(PuzzleEventArgs e) { { OnComplete?.Invoke(this, e); } }