using UnityEngine;
using System.Collections;

public class TellAIToJumpTrigger : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}

    public void OnTriggerEnter2D(Collider2D coll)
    {
        BaseEnemy enemyMans = coll.gameObject.GetComponent<BaseEnemy>();
        if (enemyMans != null)
        {
            Vector3 vEnemyTowardsUs = transform.position - enemyMans.transform.position;
            Vector3 vEnemyMovDirection = enemyMans.bFacingRight ? Vector3.right : Vector3.left;
            float fDot = Vector3.Dot(vEnemyMovDirection, vEnemyTowardsUs);
            if( fDot > 0)
                enemyMans.SuggestJump();

        }
    }

    // Update is called once per frame
	void Update () {
	
	}
}
