public void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { mob = gameObject.GetComponentInParent<MobMotor>(); mob.wherePlayer = direction; } }
public void OnTriggerExit2D(Collider2D other) { if (other.tag == "Player") { mob = gameObject.GetComponentInParent<MobMotor>(); mob.wherePlayer = MobMotor.AttackDirection.None; } }
protected virtual void Awake() { motor = GetComponent <MobMotor>(); }