// Update is called once per frame
 void Update()
 {
     animator.SetFloat("Horizontal", movementManager.GetFacingDirection().x);
     animator.SetFloat("Vertical", movementManager.GetFacingDirection().y);
     animator.SetBool("Walking", movementManager.GetWalking());
     animator.SetFloat("SpawnX", controller.SpawnDirection.x);
     animator.SetFloat("SpawnY", controller.SpawnDirection.y);
     animator.SetBool("Spawned", controller.GetIsSpawned());
 }
Example #2
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.CompareTag("Player"))
     {
         if (collision.gameObject.GetComponentInParent <MovementManager>())
         {
             collision.gameObject.GetComponentInParent <MovementManager>().Push(movement.GetFacingDirection(), pushStrength);
             collision.gameObject.transform.parent.GetComponentInChildren <HealthManager>().OnHit(2);
             FindObjectOfType <AudioManager>().Play("Push_Hit");
         }
     }
 }