浏览代码

add large blocks

/hh-develop-fps_game_project
HH 4 年前
当前提交
40d7e3b2
共有 5 个文件被更改,包括 41 次插入6 次删除
  1. 4
      Project/Assets/ML-Agents/Examples/FPS_Game/Input/FPSPlayerInputActions.cs
  2. 4
      Project/Assets/ML-Agents/Examples/FPS_Game/Input/FPSPlayerInputActions.inputactions
  3. 7
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentHealth.cs
  4. 32
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/GameController.cs

4
Project/Assets/ML-Agents/Examples/FPS_Game/Input/FPSPlayerInputActions.cs


{
""name"": """",
""id"": ""2b94ae52-9bb0-478e-8e4c-bf6c747a5c7d"",
""path"": ""<Gamepad>/leftTrigger"",
""path"": ""<Gamepad>/buttonEast"",
""interactions"": """",
""processors"": """",
""groups"": """",

{
""name"": """",
""id"": ""319796b1-6071-46f0-81dc-58b6bdb7d86a"",
""path"": ""<Gamepad>/buttonEast"",
""path"": ""<Gamepad>/leftTrigger"",
""interactions"": """",
""processors"": """",
""groups"": """",

4
Project/Assets/ML-Agents/Examples/FPS_Game/Input/FPSPlayerInputActions.inputactions


{
"name": "",
"id": "2b94ae52-9bb0-478e-8e4c-bf6c747a5c7d",
"path": "<Gamepad>/leftTrigger",
"path": "<Gamepad>/buttonEast",
"interactions": "",
"processors": "",
"groups": "",

{
"name": "",
"id": "319796b1-6071-46f0-81dc-58b6bdb7d86a",
"path": "<Gamepad>/buttonEast",
"path": "<Gamepad>/leftTrigger",
"interactions": "",
"processors": "",
"groups": "",

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


public CinemachineImpulseSource impulseSource;
public bool ResetSceneAfterDeath = false;
public bool Dead;
private GameController GameController;
GameController = FindObjectOfType<GameController>();
CurrentPercentage = 100;
UISlider.value = CurrentPercentage;
if (bodyMesh)

DeathCube.SetActive(true);
ExplosionParticles.transform.position = CubeBody.transform.position;
ExplosionParticles.SetActive(true);
if (GameController)
{
GameController.AddExplosiveForcesToAllRB(CubeBody.transform.position);
}
if (impulseSource)
{
impulseSource.GenerateImpulse();

32
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/GameController.cs


public class GameController : MonoBehaviour
{
// public List<
public List<Rigidbody> AllRBsList = new List<Rigidbody>();
public float ExplosionForce = 100;
public float ExplosionUpwardsModifier = 1;
public float ExplosionRadius = 10;
public ForceMode ExplosionForceMode;
public bool triggerExplosion;
void Start()
void Awake()
Rigidbody[] rbs = Resources.FindObjectsOfTypeAll<Rigidbody>();
foreach (var rb in rbs)
{
if (!rb.transform.CompareTag("projectile"))
{
AllRBsList.Add(rb);
}
}
if (triggerExplosion)
{
triggerExplosion = false;
AddExplosiveForcesToAllRB(transform.position);
}
}
public void AddExplosiveForcesToAllRB(Vector3 pos)
{
foreach (var rb in AllRBsList)
{
rb.AddExplosionForce(ExplosionForce, pos, ExplosionRadius, ExplosionUpwardsModifier, ExplosionForceMode);
}
}
}

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

正在加载...
取消
保存