|
|
|
|
|
|
public bool contribute; |
|
|
|
private RayPerception3D rayPer; |
|
|
|
public bool useVectorObs; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override void InitializeAgent() |
|
|
|
{ |
|
|
|
|
|
|
var rightAxis = (int)act[1]; |
|
|
|
var rotateAxis = (int)act[2]; |
|
|
|
var shootAxis = (int)act[3]; |
|
|
|
|
|
|
|
|
|
|
|
switch (forwardAxis) |
|
|
|
{ |
|
|
|
case 1: |
|
|
|
|
|
|
dirToGo = -transform.forward; |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch (rightAxis) |
|
|
|
{ |
|
|
|
case 1: |
|
|
|
|
|
|
break; |
|
|
|
case 2: |
|
|
|
rotateDir = transform.up; |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
switch (shootAxis) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
public void SetLaserLengths() |
|
|
|
{ |
|
|
|
laser_length = myAcademy.resetParameters["laser_length"]; |
|
|
|
laser_length = myAcademy.resetParameters.TryGetValue("laser_length", out laser_length) ? laser_length: 1.0f; |
|
|
|
var agent_scale = myAcademy.resetParameters["agent_scale"]; |
|
|
|
gameObject.transform.localScale = new Vector3(agent_scale, agent_scale, agent_scale); |
|
|
|
float agentScale; |
|
|
|
agentScale = myAcademy.resetParameters.TryGetValue("agent_scale", out agentScale) ? agentScale : 1.0f; |
|
|
|
gameObject.transform.localScale = new Vector3(agentScale, agentScale, agentScale); |
|
|
|
|
|
|
|
|
|
|
|
public void SetResetParameters() |
|
|
|
{ |
|
|
|
SetLaserLengths(); |
|
|
|