AIController.OnTriggerEnter2D C# (CSharp) Method

OnTriggerEnter2D() protected method

protected OnTriggerEnter2D ( Collider2D other ) : void
other UnityEngine.Collider2D
return void
	protected virtual void OnTriggerEnter2D (Collider2D other)
	{
		if (other.tag == "Player") 
		{
			playerInRange = true;
			if( getPlayer() == null )
				return;
			PossessableTree script = getPlayer ().GetComponent<PossessableTree> ();
			if (script != null && script.Eating) 
			{
				panic ();
			}
		}
		if (other.tag == "Border") 
		{
			// Only ignore collisions with the border if the NPC has not entered the map yet
			if (!enteredMap || killSelf || panicked) 
			{
				ignoreBorder (true, other);
			}
		}
	}