Ejemplo n.º 1
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        Bullet    bullet    = other.gameObject.GetComponent <Bullet>();
        Machete   machete   = other.gameObject.GetComponent <Machete>();
        SlideKick slideKick = other.gameObject.GetComponent <SlideKick>();
        Pipe      pipe      = other.gameObject.GetComponent <Pipe>();

        if (!bullet && !machete && !slideKick && !pipe)
        {
            return;
        }
        if (bullet)
        {
            ProcessBulletHit(bullet);
        }
        if (machete)
        {
            ProcessMacheteHit(machete);
        }
        if (slideKick)
        {
            ProcessSlideKick(slideKick);
        }
        if (pipe)
        {
            PipeThrust(pipe);
        }
    }
Ejemplo n.º 2
0
    private void ProcessMacheteHit(Machete machete)
    {
        //AudioSource.PlayClipAtPoint(hitSound, Camera.main.transform.position, hitSoundVolume);
        machete.CreateMacheteHitFX();
        Vector2 macheteVelocity = machete.GetMacheteDeathHitVelocty() * new Vector2(DirectionOfPlayer(), 1);

        bodyPartRigidBody.velocity = macheteVelocity;
    }
Ejemplo n.º 3
0
    private void ProcessMacheteHit(Machete machete)
    {
        //AudioSource.PlayClipAtPoint(hitSound, Camera.main.transform.position, hitSoundVolume);
        //add dust effect or somthing here
        Vector2 macheteVelocity = machete.GetMacheteDeathHitVelocty() * new Vector2(DirectionOfPlayer(), 1);

        rigidBody.velocity = macheteVelocity;
    }
Ejemplo n.º 4
0
 private void ProcessMacheteHit(Machete machete)
 {
     health -= machete.GetDamage();
     machete.CreateMacheteHitFX();
     zombieMovement.zombieRigidBody.velocity += machete.GetMacheteHitVelocity() * new Vector2(-playerPosition.DirectionOfPlayer() * machetteHitVelocityMulitplier, 1);
     zombie.zombieAnimator.SetTrigger("TakingDamage");
     zombie.zombieAnimator.SetBool("Biting", false);
     zombie.zombieAnimator.SetBool("Running", true);
     CheckIfDead();
 }