示例#1
0
    void OnTriggerEnter2D(Collider2D col)
    {
        if (col.tag == "Player")
        {
//			if (col.transform.position.x > transform.parent.position.x) {
//				if(patrol.GetIsGoingLeft())
//					transform.parent.Rotate(new Vector3(0,(patrol.GetYRotation() * -1),0));
//			} else if (col.transform.position.x < transform.parent.position.x) {
//				if(!patrol.GetIsGoingLeft())
//					transform.parent.Rotate(new Vector3(0,(patrol.GetYRotation() * -1),0));
//			}
            rotateArm.SetPlayerTarget(col.gameObject);
            patrol.SetPatrolStatus(false);
        }
    }