Exemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == StringManager.Tags.player ||
            other.tag == StringManager.Tags.redRidingHood ||
            other.tag == StringManager.Tags.pickupObj)
        {
            BaseMover mover = other.gameObject.GetComponent <BaseMover>();
            mover.SetVelocity(Vector2.zero);
            mover.SetForce(m_jumpForce);
            mover.SetJumpControlEnabled(false);

            Controller2D ctrl2D = other.GetComponent <Controller2D>();
            ctrl2D.collisions.below = false;
            ctrl2D.collisions.above = false;

            m_Animator.SetTrigger("doAnim");

            if (other.tag == StringManager.Tags.player)
            {
                other.GetComponent <PlayerMovement>().SetIsJumping(true);
            }

            if (other.tag == StringManager.Tags.redRidingHood)
            {
                other.GetComponent <RedRidingHood>().RrhDoJump();
            }
        }
    }
Exemplo n.º 2
0
Arquivo: Enemy.cs Projeto: festg/festg
 // Use this for initialization
 void Start()
 {
     mover = new YMover(this);
 }