Advertisement
Guest User

switchdir

a guest
Sep 23rd, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class SwitchDirEnemy : MonoBehaviour
  6. {
  7.     public DIRECCION nuevaDireccion;
  8.  
  9.     private void OnTriggerEnter2D(Collider2D collision)
  10.     {
  11.         if (collision.CompareTag("Enemy"))
  12.         {
  13.             collision.GetComponent<Enemy>().ChangeDir(nuevaDireccion);
  14.         }
  15.     }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement