private IEnumerator CheckPickupsCollectedOrderSquence(FlashbackPickup flashbackPickup) { _level.Player.InputEnabled = false; yield return(new WaitForMilliSeconds(Settings.Default_AlphaTween_Duration + 200)); //Get the original list in lowercase var correctOrder = FlashbackPickupsManager.Instance.FlashPickupsMap.Values.OrderBy(s => s.FlashbackData.Name) .Select(s => s.FlashbackData.Name.ToLower()); var collectOrder = _collectedFlashPickupsNames.Select(s => s.ToLower()); if (correctOrder.SequenceEqual(collectOrder)) { //Correct! Utils.print(this, " order correct ", string.Join(", ", collectOrder)); flashbackPickup.Enabled = false; yield return(CorrectFlashPickupsOrderSequence(flashbackPickup)); } else { //Incorrect order Utils.print(this, " order incorrect ", string.Join(", ", collectOrder)); yield return(IncorrectFlashPickupsOrderSequence(flashbackPickup)); GameHud.Instance.ResetFlashbackButton.SetActive(true); } }
IEnumerator Start() { //Set player objects to collide after player is set while (_level.Player == null) { yield return(null); } _level.Player.objectsToCheck = _level.Player.objectsToCheck .Concat(new GameObject[] { _hiddenRoomCoverCollider }).ToArray(); Utils.print("player index", _level.Player.Index, "fog1 index", _level.Player.Fog1.Index, "fog2 index", _level.Player.Fog2.Index); //Draw over player layer _level.AddChildAt(_hiddenRoomCover, _level.Player.Fog2.Index); //Change final pickup flashback index to be below this while (FlashbackPickupsManager.Instance?.FinalPickup == null) { yield return(null); } HierarchyManager.Instance.LateAdd(_level, FlashbackPickupsManager.Instance?.FinalPickup, _hiddenRoomCover.Index); }