isHittingWall.cs 747 Bytes
Newer Older
mthiele2's avatar
mthiele2 committed
1
2
3
4
5
6
7
8
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class isHittingWall : MonoBehaviour
{
	private void OnTriggerEnter2D(Collider2D collision)
	{
mthiele2's avatar
mthiele2 committed
9
10
		Debug.Log(collision.gameObject.layer + "stuff"+ LayerMask.NameToLayer("Ground"));
		if (!(collision.gameObject.layer == LayerMask.NameToLayer("Ground") || collision.gameObject.layer == LayerMask.NameToLayer("Enemy")))
11
12
13
		{
			return;
		}
mthiele2's avatar
mthiele2 committed
14
15
		this.GetComponentInParent<AI_WaterAttack>().turn();
	}
mthiele2's avatar
mthiele2 committed
16
17
18
19
20
21
22
23
24

	//private void OnCollisionEnter2D(Collision2D collision)
	//{
	//	if (collision.gameObject.layer == 9 || collision.gameObject.layer == LayerMask.NameToLayer("Enemy"))
	//	{
	//		Debug.Log("penis");
	//		this.GetComponentInParent<AI_WaterAttack>().turn();
	//	}
	//}
mthiele2's avatar
mthiele2 committed
25
}