浏览代码

add deathcube

/hh-develop-fps_game_project
HH 4 年前
当前提交
5ad04693
共有 3 个文件被更改,包括 974 次插入2 次删除
  1. 950
      Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity
  2. 22
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentHealth.cs
  3. 4
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/FPSAgent.cs

950
Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity
文件差异内容过多而无法显示
查看文件

22
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentHealth.cs


public float damageFlashDuration = .02f;
public ShieldController ShieldController;
public GameObject CubeBody;
public GameObject DeathCube;
public bool Dead;
// Start is called before the first frame update
void OnEnable()
{

// Update is called once per frame
void Update()
{
if (Dead)
{
return;
}
if (UISlider)
{
UISlider.value = CurrentPercentage;

private void OnCollisionEnter(Collision col)
{
if (Dead)
{
return;
}
if (col.transform.CompareTag("projectile"))
{
if (ShieldController && ShieldController.ShieldIsActive)

CurrentPercentage = Mathf.Clamp(CurrentPercentage - DepletionRate, 0, 100);
if (CurrentPercentage == 0)
{
Dead = true;
CubeBody.SetActive(false);
DeathCube.transform.position = CubeBody.transform.position;
DeathCube.SetActive(true);
print("dead");
}
StartCoroutine(BodyDamageFlash());
}
}

4
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/FPSAgent.cs


// m_CubeMovement.RunOnGround(m_AgentRb, m_Cam.transform.TransformDirection(new Vector3(0, 0, forwardAxis)));
// m_CubeMovement.Strafe(transform.right * rightAxis);
if (AgentHealth.Dead)
{
return;
}
m_InputV = act[0];
m_InputH = act[1];
m_Rotate = act[2];

正在加载...
取消
保存