using UnityEngine; using System.Collections; public class Enemy3TriggerScript : MonoBehaviour { Enemy3AttackScript attack; Enemy3FireScript fire; void Start() { attack = GetComponentInChildren(); fire = GetComponentInChildren(); } void Update() { } void OnTriggerStay2D(Collider2D col) { if (col.tag == "PlayerCollider") { fire.PlayerInRange = attack.PlayerInRange = true; } } void OnTriggerExit2D(Collider2D col) { if (col.tag == "PlayerCollider") { fire.PlayerInRange = attack.PlayerInRange = false; } } }