public void CarCollision()
 {
     m_AgentGroup.AddGroupReward(-1f);
     Cleanup();
     m_AgentGroup.EndGroupEpisode();
     ResetScene();
 }
 public void TouchedHazard(PushAgentEscape agent)
 {
     m_NumberOfRemainingPlayers--;
     if (m_NumberOfRemainingPlayers == 0 || agent.IHaveAKey)
     {
         m_AgentGroup.EndGroupEpisode();
         ResetScene();
     }
     else
     {
         agent.gameObject.SetActive(false);
     }
 }
Пример #3
0
    /// <summary>
    /// Called when the agent moves the block into the goal.
    /// </summary>
    public void ScoredAGoal(Collider col, float score)
    {
        print($"Scored {score} on {gameObject.name}");

        //Decrement the counter
        m_NumberOfRemainingBlocks--;

        //Are we done?
        bool done = m_NumberOfRemainingBlocks == 0;

        //Disable the block
        col.gameObject.SetActive(false);

        //Give Agent Rewards
        m_AgentGroup.AddGroupReward(score);

        // Swap ground material for a bit to indicate we scored.
        StartCoroutine(GoalScoredSwapGroundMaterial(m_PushBlockSettings.goalScoredMaterial, 0.5f));

        if (done)
        {
            //Reset assets
            m_AgentGroup.EndGroupEpisode();
            ResetScene();
        }
    }
Пример #4
0
 public void GoalTouched(Team scoredTeam)
 {
     if (scoredTeam == Team.Blue)
     {
         m_BlueAgentGroup.AddGroupReward(1 - m_ResetTimer / MaxEnvironmentSteps);
         m_PurpleAgentGroup.AddGroupReward(-1);
     }
     else
     {
         m_PurpleAgentGroup.AddGroupReward(1 - m_ResetTimer / MaxEnvironmentSteps);
         m_BlueAgentGroup.AddGroupReward(-1);
     }
     m_PurpleAgentGroup.EndGroupEpisode();
     m_BlueAgentGroup.EndGroupEpisode();
     ResetScene();
 }
Пример #5
0
 public void GoalTouched(Team scoredTeam)
 {
     if (scoredTeam == Team.Blue)
     {
         TeamBlue.AddGroupReward(1 - timer / MaxEnvironmentSteps);
         TeamRed.AddGroupReward(-1);
     }
     else
     {
         m_TeamRed.AddGroupReward(1 - timer / MaxEnvironmentSteps);
         TeamRed.AddGroupReward(-1);
     }
     TeamBlue.EndGroupEpisode();
     TeamRed.EndGroupEpisode();
     ResetScene();
 }