public override bool Activate() { if (AgentComponent.ActivateAgentSkill(this)) { AgentComponent.SetVelocityY(JumpPower); AgentComponent.DeactivateAgentSkill(this); return(true); } return(false); }
/// <summary> /// Activate the skill and begin any sort of animations or movements. /// </summary> public override bool Activate() { if (m_colliedWall && AgentComponent.ActivateAgentSkill(this)) { m_rigidbody2D.drag = 1f; AgentComponent.SetVelocityY(JumpPower); AgentComponent.DeactivateAgentSkill(this); m_colliedWall = false; return(true); } return(base.Activate()); }
public override bool Activate() { if (AgentComponent.ActivateAgentSkill(this)) { Debug.Log("GLIDE START"); m_isActive = true; AgentComponent.SetVelocityY(0); // Apply the gravity scale and linear drag m_rigidbody2D.gravityScale = GravityScale; m_rigidbody2D.drag = LinearDrag; // Play the glide audio and animation m_audioSource.clip = GlideAudio; m_audioSource.loop = true; m_audioSource.Play(); m_animator.SetInteger("Glide", 1); return(true); } return(false); }