浏览代码

Spawn agents first

/develop/zombieteammanager/killfirst
Ervin Teng 4 年前
当前提交
de242fc0
共有 1 个文件被更改,包括 13 次插入12 次删除
  1. 25
      Project/Assets/ML-Agents/Examples/PushBlock/Scripts/ZombiePushBlockDeathEnvController.cs

25
Project/Assets/ML-Agents/Examples/PushBlock/Scripts/ZombiePushBlockDeathEnvController.cs


}
item.Agent.EndEpisode();
}
//Reset Agents
foreach (var item in AgentsList)
{
var pos = UseRandomAgentPosition ? GetRandomSpawnPos() : item.StartingPos;
var rot = UseRandomAgentRotation ? GetRandomRot() : item.StartingRot;
item.Agent.transform.SetPositionAndRotation(pos, rot);
item.Rb.velocity = Vector3.zero;
item.Rb.angularVelocity = Vector3.zero;
item.Agent.gameObject.SetActive(true);
}
//Reset Blocks
foreach (var item in BlocksList)
{

// Freeze block's motion until zombies are killed
item.Rb.constraints |= RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionZ;
item.Rb.constraints |= RigidbodyConstraints.FreezeRotationY;
}
//Reset Agents
foreach (var item in AgentsList)
{
var pos = UseRandomAgentPosition ? GetRandomSpawnPos() : item.StartingPos;
var rot = UseRandomAgentRotation ? GetRandomRot() : item.StartingRot;
item.Agent.transform.SetPositionAndRotation(pos, rot);
item.Rb.velocity = Vector3.zero;
item.Rb.angularVelocity = Vector3.zero;
item.Agent.gameObject.SetActive(true);
}
//End Episode

正在加载...
取消
保存