private IEnumerator StartCountdown() { if (isIdolActivated) { yield break; } OrbController orb = Instantiate(orbPrefab, transform.position, Quaternion.identity).GetComponent <OrbController>(); float timeLeft = 2f; curIdol.GiveOrbDest(orb); while (timeLeft > 0) { if (!(Input.GetKey(KeyCode.F) || Input.GetKey(KeyCode.Joystick1Button2)) || Input.GetAxis("Horizontal") != 0) { orb.Destruct(); yield break; } timeLeft -= 0.01f; yield return(new WaitForSeconds(0.01f)); } isIdolActivated = true; curIdol.Activate(this); yield return(null); }
private void CloseAll() { audioSource.Pause(); curOrb.Destruct(); _curPlayer.isIdolActivated = false; isOpen = false; if (linkedIdol != null && linkedIdol.isOpen) { return; } foreach (DoorController door in doors) { door.Close(); } }