浏览代码

Merge branch 'hh/develop/dodgeball' into develop-dodgeball-tests

/develop/dodgeball-tests
Ervin Teng 3 年前
当前提交
6fa9734a
共有 5 个文件被更改,包括 30 次插入11 次删除
  1. 23
      Project/Assets/ML-Agents/Examples/Dodgeball/Scripts/DodgeBallAgent.cs
  2. 1
      Project/Assets/ML-Agents/Examples/Dodgeball/Scripts/DodgeBallGameController.cs
  3. 2
      Project/Assets/ML-Agents/Examples/Dodgeball/Scripts/PlayBackgroundAudio.cs
  4. 15
      Project/ProjectSettings/BurstAotSettings_StandaloneLinux64.json

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(10 * 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
}
}

1
Project/Assets/ML-Agents/Examples/Dodgeball/Scripts/DodgeBallGameController.cs


Quaternion.identity);
DodgeBall db = g.GetComponent<DodgeBall>();
AllBallsList.Add(db);
g.transform.SetParent(transform);
g.SetActive(true);
}

2
Project/Assets/ML-Agents/Examples/Dodgeball/Scripts/PlayBackgroundAudio.cs


using System.Collections;
using System.Collections.Generic;
// using UnityEditor.SceneManagement;
using UnityEngine.SceneManagement;
using UnityEngine;

15
Project/ProjectSettings/BurstAotSettings_StandaloneLinux64.json


{
"MonoBehaviour": {
"Version": 3,
"EnableBurstCompilation": true,
"EnableOptimisations": true,
"EnableSafetyChecks": false,
"EnableDebugInAllBuilds": false,
"UsePlatformSDKLinker": false,
"CpuMinTargetX32": 0,
"CpuMaxTargetX32": 0,
"CpuMinTargetX64": 0,
"CpuMaxTargetX64": 0,
"CpuTargetsX64": 72
}
}

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

正在加载...
取消
保存