Esempio n. 1
0
        public override bool Activate()
        {
            if (AgentComponent.ActivateAgentSkill(this))
            {
                AgentComponent.SetVelocityY(JumpPower);
                AgentComponent.DeactivateAgentSkill(this);
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        /// <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());
        }
Esempio n. 3
0
        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);
        }