浏览代码

update to hybrid actions

/hh-develop-dodgeball
HH 4 年前
当前提交
b980e390
共有 2 个文件被更改,包括 14 次插入9 次删除
  1. 23
      Project/Assets/ML-Agents/Examples/Dodgeball/Scripts/DodgeBallAgent.cs

23
Project/Assets/ML-Agents/Examples/Dodgeball/Scripts/DodgeBallAgent.cs


// }
}
public void MoveAgent(ActionSegment<float> act)
// public void MoveAgent(ActionSegment<float> act)
public void MoveAgent(ActionBuffers actionBuffers)
m_InputV = act[0];
m_InputH = act[1];
m_Rotate = act[2];
m_ThrowInput = act[3];
m_DashInput = act[4];
var continuousActions = actionBuffers.ContinuousActions;
var discreteActions = actionBuffers.DiscreteActions;
m_InputV = continuousActions[0];
m_InputH = continuousActions[1];
m_Rotate = continuousActions[2];
m_ThrowInput = (int)discreteActions[0];;
m_DashInput = (int)discreteActions[1];;
//HANDLE ROTATION
m_CubeMovement.Look(m_Rotate);

{
// print("MoveAgent");
MoveAgent(actionBuffers.ContinuousActions);
MoveAgent(actionBuffers);
}
IEnumerator ShowHitFace()

contActionsOut[1] = input.moveInput.x;
contActionsOut[2] = input.rotateInput.x; //rotate
// contActionsOut[3] = input.throwPressed ? 1 : 0; //shoot
contActionsOut[3] = input.CheckIfInputSinceLastFrame(ref input.throwPressed) ? 1 : 0; //dash
var discreteActionsOut = actionsOut.DiscreteActions;
discreteActionsOut[0] = input.CheckIfInputSinceLastFrame(ref input.throwPressed) ? 1 : 0; //dash
contActionsOut[4] = input.CheckIfInputSinceLastFrame(ref input.dashInput) ? 1 : 0; //dash
discreteActionsOut[1] = input.CheckIfInputSinceLastFrame(ref input.dashInput) ? 1 : 0; //dash
}
}

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存