28 lines
423 B
C#
28 lines
423 B
C#
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<Door>();
|
||
|
|
}
|
||
|
|
|
||
|
|
protected override bool CheckInternal ()
|
||
|
|
{
|
||
|
|
if(_door == null){
|
||
|
|
Debug.Log("WTF");
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
return _door.State != DoorState.Closed;
|
||
|
|
}
|
||
|
|
}
|