示例#1
0
    /** 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;
        }
    }
示例#2
0
 /** Toggle the builder ability. */
 public void ToggleBuilder(bool ToggleOn)
 {
     if (Ability != abilityHandler.Abilities.Builder && ToggleOn)
     {
         Ability = abilityHandler.Abilities.Builder;
     }
     else
     {
         Ability = abilityHandler.Abilities.None;
     }
 }
示例#3
0
 /** Toggle the gnawer ability. */
 public void ToggleGnawer()
 {
     if (Ability != abilityHandler.Abilities.Gnawer)
     {
         Ability = abilityHandler.Abilities.Gnawer;
     }
     else
     {
         Ability = abilityHandler.Abilities.None;
     }
 }
示例#4
0
    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);
        }
    }
示例#5
0
 /** 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);
         }
     }
 }