/** Toggle the floater ability. */ public void ToggleFloater() { if (Ability == abilityHandler.Abilities.Stopper) { ToggleStopper(); } if (Ability != abilityHandler.Abilities.Floater) { Ability = abilityHandler.Abilities.Floater; } else { Ability = abilityHandler.Abilities.None; } if (Ability == abilityHandler.Abilities.Floater) { ParachuteMesh.enabled = true; } else { ParachuteMesh.enabled = false; } }
/** Toggle the builder ability. */ public void ToggleBuilder(bool ToggleOn) { if (Ability != abilityHandler.Abilities.Builder && ToggleOn) { Ability = abilityHandler.Abilities.Builder; } else { Ability = abilityHandler.Abilities.None; } }
/** Toggle the gnawer ability. */ public void ToggleGnawer() { if (Ability != abilityHandler.Abilities.Gnawer) { Ability = abilityHandler.Abilities.Gnawer; } else { Ability = abilityHandler.Abilities.None; } }
IEnumerator RestoreMoveSpeed(float waitTime) { yield return(new WaitForSeconds(waitTime)); if (MoveDir.x > 0) { MoveDir.x = 1; } else { MoveDir.x = -1; } if (Ability == abilityHandler.Abilities.Gnawer) { Ability = abilityHandler.Abilities.None; AgentAnim.SetBool("Gnaw_Left", false); AgentAnim.SetBool("Gnaw_Right", false); } }
/** Toggle the stopper ability. */ public void ToggleStopper() { if (Ability != abilityHandler.Abilities.Stopper) { gameObject.layer = 15; Ability = abilityHandler.Abilities.Stopper; RB.mass = 50.0f; AgentAnim.Play("stopper_in", -1, 0.0f); } else { gameObject.layer = 8; Ability = abilityHandler.Abilities.None; RB.mass = 0.2f; if (MoveDir.x == -1) { AgentAnim.Play("run_left", -1, 0.0f); } else { AgentAnim.Play("run_right", -1, 0.0f); } } }