Example #1
0
    public override void AgentReset()
    {
        if (!_hasLazyInitialized)
        {
            _bodyManager            = GetComponent <BodyManager002>();
            _bodyManager.BodyConfig = MarathonManAgent.BodyConfig;
            _bodyManager.OnInitializeAgent();
            _hasLazyInitialized = true;
        }

        if (_bodyManager == null)
        {
            _bodyManager = GetComponent <BodyManager002>();
        }
        _bodyManager.OnAgentReset();
        if (_terrainGenerator == null)
        {
            _terrainGenerator = GetComponent <TerrainGenerator>();
        }
        if (_spawnableEnv == null)
        {
            _spawnableEnv = GetComponentInParent <SpawnableEnv>();
        }
        _terrainGenerator.Reset();
        lastXPosInMeters = (int)
                           _bodyManager.GetBodyParts(BodyPartGroup.Foot)
                           .Average(x => x.Transform.position.x);
        _pain = 0f;
    }
Example #2
0
 public override void AgentReset()
 {
     if (_bodyManager == null)
     {
         _bodyManager = GetComponent <BodyManager002>();
         var academy = FindObjectOfType <Academy>();
         _isTrainingMode = academy.agentSpawner.trainingMode;
     }
     _bodyManager.OnAgentReset();
     //StepsUntilChange = 0;
     //SetAction(0);
 }
Example #3
0
 public override void AgentReset()
 {
     if (!_hasLazyInitialized)
     {
         _bodyManager            = GetComponent <BodyManager002>();
         _bodyManager.BodyConfig = MarathonManAgent.BodyConfig;
         _bodyManager.OnInitializeAgent();
         _hasLazyInitialized = true;
     }
     _isDone = true;
     _bodyManager.OnAgentReset();
 }
Example #4
0
 public override void AgentReset()
 {
     if (_bodyManager == null)
     {
         _bodyManager = GetComponent <BodyManager002>();
     }
     _bodyManager.OnAgentReset();
     _episodeMaxDistance = 0f;
     if (rollingAverage == null)
     {
         rollingAverage = new RollingAverage(100);
     }
 }
Example #5
0
 public override void AgentReset()
 {
     if (!_hasLazyInitialized)
     {
         _bodyManager            = GetComponent <BodyManager002>();
         _bodyManager.BodyConfig = MarathonManAgent.BodyConfig;
         _bodyManager.OnInitializeAgent();
         _hasLazyInitialized = true;
     }
     _isDone = true;
     _bodyManager.OnAgentReset();
     _episodeMaxDistance = 0f;
     if (rollingAverage == null)
     {
         rollingAverage = new RollingAverage(100);
     }
 }
Example #6
0
 public override void AgentReset()
 {
     if (_bodyManager == null)
     {
         _bodyManager = GetComponent <BodyManager002>();
     }
     _bodyManager.OnAgentReset();
     if (_terrainGenerator == null)
     {
         _terrainGenerator = GetComponent <TerrainGenerator>();
     }
     if (_spawnableEnv == null)
     {
         _spawnableEnv = GetComponentInParent <SpawnableEnv>();
     }
     _terrainGenerator.Reset();
     lastXPosInMeters = (int)
                        _bodyManager.GetBodyParts(BodyPartGroup.Foot)
                        .Average(x => x.Transform.position.x);
     _pain        = 0f;
     _modeRecover = false;
 }
Example #7
0
	public override void AgentReset()
	{
		if (_bodyManager == null)
			_bodyManager = GetComponent<BodyManager002>();
		_bodyManager.OnAgentReset();
	}