IEnumerator PlayFinaleState() { isplayAnim = true; Debug.LogFormat("[Übermodule #{0}] All non-ignored modules have been solved, activating \"finale\" phase.", _moduleId); isFinal = true; sound.PlayGameSoundAtTransformWithRef(KMSoundOverride.SoundEffect.LightBuzz, transform); for (int cnt = 0; cnt < 4 * animationLength; cnt++) { text.color = new Color(text.color.r, text.color.g, text.color.b, (float)(1.0 - (float)cnt / animationLength / 4)); yield return(new WaitForSeconds(0)); if ((cnt % 30 >= 15 || cnt <= 2 * animationLength) && cnt % 30 < 25) { screen.material = materials[0]; } else { screen.material = materials[1]; } } screen.material = materials[1]; AdvanceStage(); isplayAnim = false; }
public IEnumerator ShowComponent(int n) { animating = true; SetSelectables(n, true); audioSelf.PlayGameSoundAtTransformWithRef(KMSoundOverride.SoundEffect.WireSequenceMechanism, transform); doors[n].transform.localPosition += new Vector3(0, -0.001f, 0); for (int i = 0; i < 10; i++) { doors[n].transform.localPosition += new Vector3((n < 2 ? 0.008f : -0.008f), 0, 0); yield return(new WaitForSeconds(0.025f)); } doors[n].SetActive(false); for (int i = 0; i < 10; i++) { components[n].transform.localPosition += new Vector3(0, 0.00121f, 0); yield return(new WaitForSeconds(0.05f)); } animating = false; }
void ButtonPressed(int buttonNumber) { StartCoroutine(ButtonAnimation(buttonGameObjects[buttonNumber])); buttons[buttonNumber].AddInteractionPunch(.5f); moduleAudio.PlayGameSoundAtTransformWithRef(KMSoundOverride.SoundEffect.ButtonPress, buttons[buttonNumber].transform); if (amountOfButtonsPressed >= correctButtonOrder.Length) { return; } if (buttonNumber + 1 == correctButtonOrder[amountOfButtonsPressed]) // buttonNumber originally starts at 0, so +1 { amountOfButtonsPressed++; moduleAudio.PlaySoundAtTransform(sounds[amountOfButtonsPressed - 1], module.transform); StartCoroutine(ClearCorrectNumbers(displays[buttonNumber])); if (amountOfButtonsPressed > 2) { module.HandlePass(); ModuleSolved(); } } else { moduleAudio.PlaySoundAtTransform(sounds[amountOfButtonsPressed], module.transform); module.HandleStrike(); ResetModule(); } }
private IEnumerator PlayFakeNeedy() { _ref = _audio.PlayGameSoundAtTransformWithRef(KMSoundOverride.SoundEffect.NeedyWarning, transform); yield return(new WaitForSeconds(5.0f)); _ref.StopSound(); _ref = null; gameObject.SetActive(false); }