Пример #1
0
 void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.CompareTag("GoalA"))
     {
         ResetPosition();
         AgentB.ScoredGoal();
         AgentA.OpponentScored();
         AgentA.AgentReset();
         AgentB.AgentReset();
     }
     if (col.gameObject.CompareTag("GoalB"))
     {
         ResetPosition();
         AgentA.ScoredGoal();
         AgentB.OpponentScored();
         AgentA.AgentReset();
         AgentB.AgentReset();
     }
 }
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.CompareTag("GoalA"))
        {
            ResetPosition();
            AgentB.ScoredGoal();
            AgentA.OpponenwtScored();
            AgentA.EndEpisode();
            AgentB.EndEpisode();
        }

        if (collision.gameObject.CompareTag("GoalB"))
        {
            ResetPosition();
            AgentA.ScoredGoal();
            AgentB.OpponenwtScored();
            AgentA.EndEpisode();
            AgentB.EndEpisode();
        }
    }