Пример #1
0
 void OnTriggerEnter(Collider col)
 {
     // Touched target.
     if (col.gameObject.CompareTag("agent"))
     {
         gameObject.SetActive(false);
         agent.ReachedTarget();
     }
 }
Пример #2
0
 private void OnCollisionEnter(Collision other)
 {
     // Touched target.
     if (other.gameObject.CompareTag("spiderAgent"))
     {
         AddRewardWithScore(-1f);
         gameObject.SetActive(false);
         spider.ReachedTarget();
         EndEpisode();
     }
 }