IEnumerator UpdateStance() { switch (player.current_weapon) { case Weapon.BOW: currentStance = bowStance; break; case Weapon.KNIFE: currentStance = knifeStance; break; case Weapon.SPEAR: currentStance = spearStance; break; default: break; } while (player.charge > 0.0f) { sr.sprite = currentStance.armed; yield return(null); } sr.sprite = currentStance.afterThrow; yield return(HushPuppy.WaitForEndOfFrames(recoveryFrames)); sr.sprite = defaultSprite; }
IEnumerator display_text(string text) { int current_character; for (current_character = 0; current_character < text.Length; current_character++) { text_running = true; if (pressed_key) { pressed_key = false; break; } intro_text.text = text.Substring(0, current_character) + "<color=#0000>" + text.Substring(current_character) + "</color>"; yield return(HushPuppy.WaitForEndOfFrames(2)); } text_running = false; intro_text.text = text; }
IEnumerator Display_String(string text, int speed) { int current_character = 0; text_running = true; while (true) { if (current_character == text.Length || skip_display) { break; } dialogText.text = text.Substring(0, current_character++); yield return(HushPuppy.WaitForEndOfFrames(speed)); } skip_display = false; text_running = false; dialogText.text = text; }
IEnumerator Collect_Magnet_Cooldown() { yield return(HushPuppy.WaitForEndOfFrames(30)); knife_magnet_deployed = false; }