浏览代码

fix dash input bug. working

/hh-develop-fps_game_project
HH 4 年前
当前提交
2cd5cc5d
共有 11 个文件被更改,包括 1120 次插入6 次删除
  1. 1
      Project/Assets/ML-Agents/Examples/FPS_Game/Input/FPSAgentInput.cs
  2. 2
      Project/Assets/ML-Agents/Examples/FPS_Game/Input/FPSPlayerInputActions.cs
  3. 2
      Project/Assets/ML-Agents/Examples/FPS_Game/Input/FPSPlayerInputActions.inputactions
  4. 6
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentHealth.cs
  5. 12
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/FPSAgent.cs
  6. 6
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/GameController.cs
  7. 1001
      Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/FPSAgent.prefab
  8. 7
      Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/FPSAgent.prefab.meta
  9. 81
      Project/Assets/ML-Agents/Examples/SharedAssets/Materials/GrayLight.mat
  10. 8
      Project/Assets/ML-Agents/Examples/SharedAssets/Materials/GrayLight.mat.meta

1
Project/Assets/ML-Agents/Examples/FPS_Game/Input/FPSAgentInput.cs


public float rotateInput;
public bool shieldInput;
public Camera Cam;
// Start is called before the first frame update
void Awake()
{

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


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

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


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

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


[Header("PLAYER DAMAGE")] public bool UseGlobalDamageSettings;
public float DamagePerHit = 15f; //constant rate at which ammo depletes when being used
private Rigidbody rb;
// Start is called before the first frame update
void OnEnable()
{

{
startingColor = bodyMesh.sharedMaterial.color;
}
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame

if (CurrentPercentage == 0)
{
Dead = true;
rb.isKinematic = true;
// rb.velocity = Vector3.zero;
// rb.angularVelocity = Vector3.zero;
CubeBody.SetActive(false);
DeathCube.transform.position = CubeBody.transform.position;
DeathCube.SetActive(true);

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


Rigidbody m_AgentRb;
// bool m_Shoot;
private Camera m_Cam;
// private Camera m_Cam;
private FPSAgentInput input;
public FPSAgentInput input;
m_Cam = Camera.main;
// m_Cam = Camera.main;
m_AgentRb = GetComponent<Rigidbody>();
input = GetComponent<FPSAgentInput>();
}

m_CubeMovement = GetComponent<AgentCubeMovement>();
// m_Cam = Camera.main;
m_AgentRb = GetComponent<Rigidbody>();
input = GetComponent<FPSAgentInput>();
// Unfreeze();
// Unpoison();
// Unsatiate();

m_Rotate = act[2];
m_ShootInput = act[3];
m_CubeMovement.RotateBody(m_Rotate, m_InputV);
Vector3 moveDir = m_Cam.transform.TransformDirection(new Vector3(m_InputH, 0, m_InputV));
Vector3 moveDir = input.Cam.transform.TransformDirection(new Vector3(m_InputH, 0, m_InputV));
// m_CubeMovement.RunOnGround(m_AgentRb, m_Cam.transform.TransformDirection(new Vector3(0, 0, m_InputV)));
m_CubeMovement.RunOnGround(m_AgentRb, moveDir);
// if (m_InputH != 0)

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


public bool triggerExplosion;
public enum GameMode
{
SinglePlayer, PVP_Single
}
public GameMode gameMode;
[Header("PLAYER DAMAGE")]
public float DamagePerHit = 15;
// Start is called before the first frame update

1001
Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/FPSAgent.prefab
文件差异内容过多而无法显示
查看文件

7
Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/FPSAgent.prefab.meta


fileFormatVersion: 2
guid: a0e7db83e097b4a3e96a89b390d1ebed
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

81
Project/Assets/ML-Agents/Examples/SharedAssets/Materials/GrayLight.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: GrayLight
m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 0
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.7075472, g: 0.7075472, b: 0.7075472, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

8
Project/Assets/ML-Agents/Examples/SharedAssets/Materials/GrayLight.mat.meta


fileFormatVersion: 2
guid: d80d2699d44b64e0aa3dfa5ca2ffca09
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

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

正在加载...
取消
保存