7 namespace droid.Runtime.Prototyping.Evaluation {
11 [AddComponentMenu(EvaluationComponentMenuPath._ComponentMenuPath
13 + EvaluationComponentMenuPath._Postfix)]
15 [SerializeField]
Actor _actor = null;
17 [SerializeField]
bool _based_on_tags =
false;
22 [SerializeField] ActorOverlapping _overlapping = ActorOverlapping.Outside_area_;
30 Mathf.Abs(Vector3.Distance(
this._goal.transform.position,
this._actor.transform.position));
32 if (this._overlapping == ActorOverlapping.Inside_area_ || distance < 0.5f) {
33 this.ParentEnvironment.Terminate(
"Inside goal area");
45 this._overlapping = ActorOverlapping.Outside_area_;
62 this._goal = FindObjectOfType<EmptyCell>();
66 this._actor = FindObjectOfType<Actor>();
77 .OnTriggerEnterChild);
88 .OnTriggerEnterChild);
92 void OnTriggerEnterChild(GameObject child_game_object, Collider other_game_object) {
93 Debug.Log(
"triggered");
95 if (this._based_on_tags) {
96 if (other_game_object.CompareTag(
this._actor.tag)) {
99 Debug.Log(
"Actor is inside area");
103 this._overlapping = ActorOverlapping.Inside_area_;
106 if (child_game_object == this._goal.gameObject
107 && other_game_object.gameObject ==
this._actor.gameObject) {
109 if (this.Debugging) {
110 Debug.Log(
"Actor is inside area");
113 this._overlapping = ActorOverlapping.Inside_area_;
121 enum ActorOverlapping {
override float InternalEvaluate()
void SetGoal(EmptyCell goal)
override void PostSetup()
override void InternalReset()