using UnityEngine; using System.Collections; public class DoorPredicate : Predicate { protected override bool CheckInternal (object param) { return Check (); } private Door _door; void Start(){ _door = gameObject.GetComponentInChildren(); } protected override bool CheckInternal () { if(_door == null){ Debug.Log("WTF"); return false; } return _door.State != DoorState.Closed; } }