浏览代码

Added FPS scene with new camera, character, and gun. no agent yet

/hh-develop-fps_game_project
HH 4 年前
当前提交
307ea28d
共有 29 个文件被更改,包括 2925 次插入0 次删除
  1. 1
      Project/Packages/manifest.json
  2. 8
      Project/Assets/ML-Agents/Examples/FPS_Game.meta
  3. 8
      Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs.meta
  4. 867
      Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/PlayerCubeWithGun.prefab
  5. 7
      Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/PlayerCubeWithGun.prefab.meta
  6. 129
      Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/Projectile.prefab
  7. 7
      Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/Projectile.prefab.meta
  8. 8
      Project/Assets/ML-Agents/Examples/FPS_Game/Scenes.meta
  9. 764
      Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity
  10. 7
      Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity.meta
  11. 8
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts.meta
  12. 81
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentCubeGroundCheck.cs
  13. 11
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentCubeGroundCheck.cs.meta
  14. 205
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentCubeMovement.cs
  15. 11
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentCubeMovement.cs.meta
  16. 355
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AvgCenterOfMass.cs
  17. 11
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AvgCenterOfMass.cs.meta
  18. 135
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/CollisionCallbacks.cs
  19. 11
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/CollisionCallbacks.cs.meta
  20. 84
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/Projectile.cs
  21. 11
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/Projectile.cs.meta
  22. 32
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/RandomTorqueEveryXSec.cs
  23. 11
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/RandomTorqueEveryXSec.cs.meta
  24. 142
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/ShootProjectiles.cs
  25. 11
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/ShootProjectiles.cs.meta

1
Project/Packages/manifest.json


"dependencies": {
"com.unity.ads": "2.0.8",
"com.unity.analytics": "3.2.3",
"com.unity.cinemachine": "2.6.3",
"com.unity.collab-proxy": "1.2.15",
"com.unity.ml-agents": "file:../../com.unity.ml-agents",
"com.unity.ml-agents.extensions": "file:../../com.unity.ml-agents.extensions",

8
Project/Assets/ML-Agents/Examples/FPS_Game.meta


fileFormatVersion: 2
guid: 024b4dda46cdd42fa9a4935f866d39ee
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs.meta


fileFormatVersion: 2
guid: fd972db1166c344a3a10870647469abc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

867
Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/PlayerCubeWithGun.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1227455081
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1227455082}
- component: {fileID: 1227455085}
- component: {fileID: 1227455084}
- component: {fileID: 1227455083}
m_Layer: 0
m_Name: cm
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1227455082
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1227455081}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1517390719}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1227455085
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1227455081}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ac0b09e7857660247b1477e93731de29, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1227455084
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1227455081}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4044717213e31446939f7bd49c896ea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_TrackedObjectOffset: {x: 0, y: 0, z: 0}
m_LookaheadTime: 0.2
m_LookaheadSmoothing: 1
m_LookaheadIgnoreY: 0
m_HorizontalDamping: 0.1
m_VerticalDamping: 20
m_ScreenX: 0.5
m_ScreenY: 0.68
m_DeadZoneWidth: 0
m_DeadZoneHeight: 0
m_SoftZoneWidth: 0.8
m_SoftZoneHeight: 0.8
m_BiasX: 0
m_BiasY: -0.000000074505806
m_CenterOnActivate: 1
--- !u!114 &1227455083
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1227455081}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fa7155796051b734daa718462081dc5f, type: 3}
m_Name:
m_EditorClassIdentifier:
m_BindingMode: 5
m_FollowOffset: {x: 0, y: 2, z: -5}
m_XDamping: 1
m_YDamping: 1
m_ZDamping: 1
m_AngularDampingMode: 0
m_PitchDamping: 0
m_YawDamping: 0
m_RollDamping: 0
m_AngularDamping: 0
--- !u!1 &1517390717
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1517390719}
- component: {fileID: 1517390718}
m_Layer: 0
m_Name: AgentVCam
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1517390719
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1517390717}
m_LocalRotation: {x: 0.087676235, y: -0.0000000039375903, z: 3.4656758e-10, w: 0.99614906}
m_LocalPosition: {x: 0, y: 1.9999999, z: -5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1227455082}
m_Father: {fileID: 2170513383808163269}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1517390718
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1517390717}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 45e653bab7fb20e499bda25e1b646fea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ExcludedPropertiesInInspector:
- m_Script
m_LockStageInInspector:
m_StreamingVersion: 20170927
m_Priority: 10
m_StandbyUpdate: 2
m_LookAt: {fileID: 2170513384791859414}
m_Follow: {fileID: 2170513384791859414}
m_Lens:
FieldOfView: 60
OrthographicSize: 5
NearClipPlane: 0.3
FarClipPlane: 1000
Dutch: 0
LensShift: {x: 0, y: 0}
m_Transitions:
m_BlendHint: 0
m_InheritPosition: 0
m_OnCameraLive:
m_PersistentCalls:
m_Calls: []
m_LegacyBlendHint: 0
m_ComponentOwner: {fileID: 1227455082}
--- !u!1 &1876700408
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1876700409}
- component: {fileID: 1876700410}
m_Layer: 0
m_Name: Area Light (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &1876700409
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1876700408}
m_LocalRotation: {x: -0, y: -0.7071068, z: 0.7071068, w: 0}
m_LocalPosition: {x: 0, y: 5, z: 2.06}
m_LocalScale: {x: 2, y: 0.5000005, z: 3}
m_Children: []
m_Father: {fileID: 2170513384791859414}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!108 &1876700410
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1876700408}
m_Enabled: 1
serializedVersion: 8
m_Type: 2
m_Color: {r: 1, g: 0.9212542, b: 0.3915094, a: 1}
m_Intensity: 15
m_Range: 7
m_SpotAngle: 125
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!1 &2170513383024431815
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513383024431812}
- component: {fileID: 2170513383024431810}
- component: {fileID: 2170513383024431813}
m_Layer: 0
m_Name: eye
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2170513383024431812
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383024431815}
m_LocalRotation: {x: -0, y: 1, z: -0, w: 0}
m_LocalPosition: {x: 0.29999995, y: 0.07399994, z: 0.50040054}
m_LocalScale: {x: 0.29457998, y: 0.29457998, z: 0.29457998}
m_Children: []
m_Father: {fileID: 2170513383808163269}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!33 &2170513383024431810
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383024431815}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2170513383024431813
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383024431815}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: f731be6866ce749fd8349e67ae81f76a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &2170513383347468444
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513383347468445}
- component: {fileID: 2170513383347468443}
- component: {fileID: 2170513383347468442}
m_Layer: 0
m_Name: mouth
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2170513383347468445
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383347468444}
m_LocalRotation: {x: -0, y: 1, z: -0, w: 0}
m_LocalPosition: {x: 0, y: -0.18299997, z: 0.50040054}
m_LocalScale: {x: 0.27602, y: 0.042489994, z: 0.13891}
m_Children: []
m_Father: {fileID: 2170513383808163269}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!33 &2170513383347468443
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383347468444}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2170513383347468442
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383347468444}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: f731be6866ce749fd8349e67ae81f76a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &2170513383808163268
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513383808163269}
- component: {fileID: 2170513383808163267}
- component: {fileID: 2170513383808163266}
m_Layer: 0
m_Name: AgentCube_Blue
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2170513383808163269
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383808163268}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2170513384853870151}
- {fileID: 2170513383024431812}
- {fileID: 2170513384254877933}
- {fileID: 2170513383347468445}
- {fileID: 2170513384182965506}
- {fileID: 1517390719}
m_Father: {fileID: 2170513384791859414}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &2170513383808163267
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383808163268}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2170513383808163266
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513383808163268}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: c9fa44c2c3f8ce74ca39a3355ea42631, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &2170513384182965509
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513384182965506}
- component: {fileID: 2170513384182965504}
- component: {fileID: 2170513384182965507}
m_Layer: 0
m_Name: Headband
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2170513384182965506
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384182965509}
m_LocalRotation: {x: -0, y: -0, z: 0.016506119, w: 0.9998638}
m_LocalPosition: {x: 0, y: 0.341, z: 0}
m_LocalScale: {x: 1.0441425, y: 0.19278127, z: 1.0441422}
m_Children: []
m_Father: {fileID: 2170513383808163269}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: -179.99998, z: 1.8920001}
--- !u!33 &2170513384182965504
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384182965509}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2170513384182965507
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384182965509}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 04be259c590de46f69db4cbd1da877d5, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &2170513384254877932
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513384254877933}
- component: {fileID: 2170513384254877931}
- component: {fileID: 2170513384254877930}
m_Layer: 0
m_Name: eye
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2170513384254877933
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384254877932}
m_LocalRotation: {x: -0, y: 1, z: -0, w: 0}
m_LocalPosition: {x: -0.29999995, y: 0.07399994, z: 0.50040054}
m_LocalScale: {x: 0.29457998, y: 0.29457998, z: 0.29457998}
m_Children: []
m_Father: {fileID: 2170513383808163269}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!33 &2170513384254877931
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384254877932}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &2170513384254877930
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384254877932}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: f731be6866ce749fd8349e67ae81f76a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &2170513384717669919
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513384717669916}
- component: {fileID: 2170513384717669917}
m_Layer: 0
m_Name: GUN
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2170513384717669916
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384717669919}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 1.02}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2170513384791859414}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2170513384717669917
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384717669919}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f25a3868f6567418d8fca3276794e44a, type: 3}
m_Name:
m_EditorClassIdentifier:
initialized: 0
projectilePrefab: {fileID: 3911029810215854908, guid: 01e75f85d5a3c451b9a5bed7070be0a0,
type: 3}
numberOfProjectilesToPool: 25
projectileStartingPos: {fileID: 2170513384717669916}
projectileLaunchAngle: 1
shootingRate: 0.02
coolDownWait: 0
autoShootEnabled: 0
autoShootDistance: 30
useStandaloneInput: 0
shootKey: 106
--- !u!1 &2170513384791859417
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513384791859414}
- component: {fileID: 2170513384791859413}
- component: {fileID: 2170513384791859412}
- component: {fileID: 2170513384791859415}
- component: {fileID: 2170513384791859410}
m_Layer: 0
m_Name: PlayerCubeWithGun
m_TagString: agent
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2170513384791859414
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384791859417}
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2170513383808163269}
- {fileID: 2170513384717669916}
- {fileID: 1876700409}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!54 &2170513384791859413
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384791859417}
serializedVersion: 2
m_Mass: 3
m_Drag: 0.05
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 80
m_CollisionDetection: 3
--- !u!65 &2170513384791859412
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384791859417}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &2170513384791859415
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384791859417}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0b86732e5cf714ed6ba8b18dd80f458c, type: 3}
m_Name:
m_EditorClassIdentifier:
maxAngularVel: 50
runningForceMode: 1
agentRunSpeed: 10
agentTerminalVel: 20
agentRunInAirSpeed: 7
dashBoostForce: 20
dashForceMode: 1
dashPressed: 0
agentIdleDragVelCoeff: 0.9
groundPoundForceMode: 1
groundPoundForce: 35
spinAttackSpeed: 20
agentRotationSpeed: 10
agentJumpVelocity: 15
agentFallingSpeed: 50
cam: {fileID: 0}
--- !u!114 &2170513384791859410
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384791859417}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 10d5e726b74514f6ebff817a3a2a3b28, type: 3}
m_Name:
m_EditorClassIdentifier:
debugDrawGizmos: 0
hitGroundColliders:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
groundCheckBoxLocalPos: {x: 0, y: -0.52, z: 0}
groundCheckBoxSize: {x: 0.99, y: 0.1, z: 0.99}
isGrounded: 0
ungroundedTime: 0
groundedTime: 0
--- !u!1 &2170513384853870150
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2170513384853870151}
- component: {fileID: 2170513384853870148}
m_Layer: 0
m_Name: AgentCameraEyes
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &2170513384853870151
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384853870150}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.15}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2170513383808163269}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!20 &2170513384853870148
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2170513384853870150}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0.46666667, g: 0.5647059, b: 0.60784316, a: 1}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294950911
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022

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


fileFormatVersion: 2
guid: 497c5a1fa56ff4204a66acfb42a8ebde
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

129
Project/Assets/ML-Agents/Examples/FPS_Game/Prefabs/Projectile.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3911029810215854908
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3911029810215854904}
- component: {fileID: 3911029810215854911}
- component: {fileID: 3911029810215854910}
- component: {fileID: 3911029810215854909}
- component: {fileID: 648473049}
- component: {fileID: 4341296992446652170}
m_Layer: 0
m_Name: Projectile
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3911029810215854904
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 2.8, z: 0}
m_LocalScale: {x: 0.4, y: 0.4, z: 0.4}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &3911029810215854911
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &3911029810215854910
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 52eab8ab5010f438fab93da85735ba1d, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!65 &3911029810215854909
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &648473049
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 760a84ae2ce8446b28d91ff804e233cf, type: 3}
m_Name:
m_EditorClassIdentifier:
aliveTime: 0
rb: {fileID: 0}
selfDestructNow: 0
maxTimeToLive: 3
pauseCollisionDetectionWaitTime: 0.5
projectileController: {fileID: 0}
--- !u!54 &4341296992446652170
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3911029810215854908}
serializedVersion: 2
m_Mass: 10
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 0
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 3

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


fileFormatVersion: 2
guid: 01e75f85d5a3c451b9a5bed7070be0a0
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Project/Assets/ML-Agents/Examples/FPS_Game/Scenes.meta


fileFormatVersion: 2
guid: 9bc6618ed6da64ed6bc7736b2c468cc2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

764
Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.8, g: 0.8, b: 0.8, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 10
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 2
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 112000002, guid: 79aaf90aa86a141da808b7768b9f1403,
type: 2}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &193531851
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.x
value: 0.31598538
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.y
value: -0.3596048
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.z
value: 0.13088542
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.w
value: 0.8681629
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
--- !u!4 &872039382 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 2170513384791859414, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
m_PrefabInstance: {fileID: 1510012663}
m_PrefabAsset: {fileID: 0}
--- !u!1 &966474450
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 966474451}
m_Layer: 0
m_Name: Cinemachine
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &966474451
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 966474450}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.29858035, y: 1.127, z: -1.497391}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1828481692}
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1392866527
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1392866532}
- component: {fileID: 1392866531}
- component: {fileID: 1392866529}
- component: {fileID: 1392866528}
- component: {fileID: 1392866533}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!81 &1392866528
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1392866527}
m_Enabled: 1
--- !u!124 &1392866529
Behaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1392866527}
m_Enabled: 1
--- !u!20 &1392866531
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1392866527}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0.46666667, g: 0.5647059, b: 0.60784316, a: 1}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.1
far clip plane: 100
field of view: 60
orthographic: 0
orthographic size: 10
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1392866532
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1392866527}
m_LocalRotation: {x: 0.19826692, y: -0.6208851, z: 0.16636568, w: 0.73994213}
m_LocalPosition: {x: 10.2, y: 7.16, z: -0.59}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 30, y: -80, z: 0}
--- !u!114 &1392866533
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1392866527}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ec40c70d5160b47cd8deaab79e24892c, type: 3}
m_Name:
m_EditorClassIdentifier:
target: {fileID: 872039382}
smoothingTime: 0.1
--- !u!1001 &1481808307
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3}
--- !u!1001 &1510012663
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1517390719, guid: 497c5a1fa56ff4204a66acfb42a8ebde, type: 3}
propertyPath: m_LocalRotation.x
value: 0.08767625
objectReference: {fileID: 0}
- target: {fileID: 1517390719, guid: 497c5a1fa56ff4204a66acfb42a8ebde, type: 3}
propertyPath: m_LocalRotation.y
value: 0.00000002600996
objectReference: {fileID: 0}
- target: {fileID: 1517390719, guid: 497c5a1fa56ff4204a66acfb42a8ebde, type: 3}
propertyPath: m_LocalRotation.z
value: -0.0000000022892717
objectReference: {fileID: 0}
- target: {fileID: 2170513384791859414, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.29858035
objectReference: {fileID: 0}
- target: {fileID: 2170513384791859414, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
propertyPath: m_LocalPosition.y
value: 1.127
objectReference: {fileID: 0}
- target: {fileID: 2170513384791859414, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2170513384791859414, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2170513384791859414, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
propertyPath: m_LocalRotation.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2170513384791859414, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2170513384791859414, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
propertyPath: m_LocalRotation.w
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2170513384791859414, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2170513384791859414, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2170513384791859414, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 180
objectReference: {fileID: 0}
- target: {fileID: 2170513384791859414, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2170513384791859415, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
propertyPath: cam
value:
objectReference: {fileID: 1828481695}
- target: {fileID: 2170513384791859417, guid: 497c5a1fa56ff4204a66acfb42a8ebde,
type: 3}
propertyPath: m_Name
value: PlayerCubeWithGun
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 497c5a1fa56ff4204a66acfb42a8ebde, type: 3}
--- !u!1 &1828481691
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1828481692}
- component: {fileID: 1828481695}
- component: {fileID: 1828481694}
- component: {fileID: 1828481693}
m_Layer: 0
m_Name: Camera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1828481692
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1828481691}
m_LocalRotation: {x: -0.0000000022892717, y: 0.99614906, z: -0.08767625, w: -0.00000002600996}
m_LocalPosition: {x: 0, y: 1.9999999, z: 6.4973907}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 966474451}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1828481693
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1828481691}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 72ece51f2901e7445ab60da3685d6b5f, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowDebugText: 0
m_ShowCameraFrustum: 1
m_IgnoreTimeScale: 0
m_WorldUpOverride: {fileID: 0}
m_UpdateMethod: 2
m_BlendUpdateMethod: 1
m_DefaultBlend:
m_Style: 1
m_Time: 2
m_CustomCurve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_CustomBlends: {fileID: 0}
m_CameraCutEvent:
m_PersistentCalls:
m_Calls: []
m_CameraActivatedEvent:
m_PersistentCalls:
m_Calls: []
--- !u!81 &1828481694
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1828481691}
m_Enabled: 1
--- !u!20 &1828481695
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1828481691}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!1 &2095421678
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2095421679}
- component: {fileID: 2095421681}
- component: {fileID: 2095421680}
m_Layer: 0
m_Name: CrawlerSettings
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2095421679
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2095421678}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 2, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2095421680
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2095421678}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ec51f47c5ed0478080c449c74fd9c154, type: 3}
m_Name:
m_EditorClassIdentifier:
gravityMultiplier: 1
fixedDeltaTime: 0.02
maximumDeltaTime: 0.33333334
solverIterations: 6
solverVelocityIterations: 1
reuseCollisionCallbacks: 1
--- !u!114 &2095421681
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2095421678}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3d6f3eab3776b4fb79724ac4216dfd7b, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &6815147847201213989
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3421283061859478279, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_LocalPosition.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3421283062001101768, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_LocalPosition.z
value: 4.46
objectReference: {fileID: 0}
- target: {fileID: 3421283062001101770, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: targetPrefab
value:
objectReference: {fileID: 3839136118347789758, guid: 46734abd0de454192b407379c6a4ab8d,
type: 3}
- target: {fileID: 3421283062001101770, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: target
value:
objectReference: {fileID: 0}
- target: {fileID: 3421283062001101770, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_TargetWalkingSpeed
value: 15
objectReference: {fileID: 0}
- target: {fileID: 3421283062001101771, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 53b79c6f40aeb46e693e7c1822ff1047,
type: 3}
- target: {fileID: 6810587057221831324, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6810587057221831324, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6810587057221831324, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6810587057221831324, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6810587057221831324, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6810587057221831324, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6810587057221831324, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6810587057221831324, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
- target: {fileID: 6810587057221831324, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6810587057221831324, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6810587057221831324, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6813981368972186340, guid: 0058b366f9d6d44a3ba35beb06b0174b,
type: 3}
propertyPath: m_Name
value: DynamicPlatform
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0058b366f9d6d44a3ba35beb06b0174b, type: 3}

7
Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity.meta


fileFormatVersion: 2
guid: bb9eaf2690d8442a396456665bfe11d6
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts.meta


fileFormatVersion: 2
guid: 7a8babe269eed419bab27195fe93a356
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

81
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentCubeGroundCheck.cs


//Standardized ground check for the Agent Cube
using UnityEngine;
namespace MLAgents
{
/// <summary>
/// Perform Groundcheck using a Physics OverlapBox
/// </summary>
[DisallowMultipleComponent]
public class AgentCubeGroundCheck : MonoBehaviour
{
public bool debugDrawGizmos;
public Collider[] hitGroundColliders = new Collider[3];
public Vector3 groundCheckBoxLocalPos = new Vector3(0, -0.52f, 0);
public Vector3 groundCheckBoxSize = new Vector3(0.99f, 0.1f, 0.99f);
public bool isGrounded;
public float ungroundedTime; //amount of time agent hasn't been grounded
public float groundedTime; //amount of time agent has been grounded
void FixedUpdate()
{
DoGroundCheck();
if (!isGrounded)
{
ungroundedTime += Time.deltaTime;
groundedTime = 0;
}
else
{
groundedTime += Time.deltaTime;
ungroundedTime = 0;
}
}
/// <summary>
/// Does the ground check.
/// </summary>
/// <returns><c>true</c>, if the agent is on the ground,
/// <c>false</c> otherwise.</returns>
/// <param name="smallCheck"></param>
public void DoGroundCheck()
{
isGrounded = false;
if (Physics.OverlapBoxNonAlloc(
transform.TransformPoint(groundCheckBoxLocalPos),
groundCheckBoxSize / 2,
hitGroundColliders,
transform.rotation) > 0)
{
foreach (var col in hitGroundColliders)
{
if (col != null && col.transform != transform &&
(col.CompareTag("walkableSurface")
|| col.CompareTag("ground")
|| col.CompareTag("block")))
{
isGrounded = true; //then we're grounded
break;
}
}
}
//empty the array
for (int i = 0; i < hitGroundColliders.Length; i++)
{
hitGroundColliders[i] = null;
}
}
//Draw the Box Overlap as a gizmo to show where it currently is testing.
void OnDrawGizmos()
{
if (debugDrawGizmos)
{
Gizmos.color = Color.red;
Gizmos.matrix = transform.localToWorldMatrix;
Gizmos.DrawWireCube(groundCheckBoxLocalPos, groundCheckBoxSize);
}
}
}
}

11
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentCubeGroundCheck.cs.meta


fileFormatVersion: 2
guid: 10d5e726b74514f6ebff817a3a2a3b28
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

205
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentCubeMovement.cs


//Standardized movement controller for the Agent Cube
using System;
using Unity.Mathematics;
using UnityEngine;
namespace MLAgents
{
public class AgentCubeMovement : MonoBehaviour
{
[Header("RIGIDBODY")] public float maxAngularVel = 50;
[Header("RUNNING")] public ForceMode runningForceMode = ForceMode.Impulse;
//speed agent can run if grounded
public float agentRunSpeed = 10;
public float agentTerminalVel = 20;
//speed agent can run if not grounded
public float agentRunInAirSpeed = 7f;
[Header("DASH")]
public float dashBoostForce = 20f;
public ForceMode dashForceMode = ForceMode.Impulse;
public bool dashPressed;
[Header("IDLE")]
//coefficient used to dampen velocity when idle
//the purpose of this is to fine tune agent drag
//...and prevent the agent sliding around while grounded
//0 means it will instantly stop when grounded
//1 means no drag will be applied
public float agentIdleDragVelCoeff = .9f;
[Header("GROUND POUND")]
public ForceMode groundPoundForceMode = ForceMode.Impulse;
public float groundPoundForce = 35f;
[Header("SPIN ATTACK")]
public float spinAttackSpeed = 20f;
private bool spinAttack;
[Header("BODY ROTATION")]
//body rotation speed
public float agentRotationSpeed = 35f;
[Header("JUMPING")]
//upward jump velocity magnitude
public float agentJumpVelocity = 15f;
[Header("FALLING FORCE")]
//force applied to agent while falling
public float agentFallingSpeed = 50f;
public Camera cam;
private Vector3 lookDir;
private Rigidbody rb;
private AgentCubeGroundCheck groundCheck;
void Awake()
{
rb = GetComponent<Rigidbody>();
groundCheck = GetComponent<AgentCubeGroundCheck>();
rb.maxAngularVelocity = maxAngularVel;
}
void Update()
{
var camForward = cam.transform.forward;
camForward.y = 0;
var camRight = cam.transform.right;
lookDir = Vector3.zero;
lookDir += Input.GetKey(KeyCode.D) ? Vector3.right : Vector3.zero;
lookDir += Input.GetKey(KeyCode.W) ? Vector3.forward : Vector3.zero;
lookDir += Input.GetKey(KeyCode.A) ? Vector3.left : Vector3.zero;
lookDir += Input.GetKey(KeyCode.S) ? Vector3.back : Vector3.zero;
if (Input.GetKeyDown(KeyCode.Space))
{
if (groundCheck)
{
if (groundCheck.isGrounded)
{
Jump(rb);
}
else
{
rb.AddForce(Vector3.down * groundPoundForce, groundPoundForceMode);
}
}
}
spinAttack = Input.GetKey(KeyCode.H);
dashPressed = Input.GetKeyDown(KeyCode.K);
if (dashPressed)
{
// dashPressed = false;
// rb.AddForce(rb.transform.forward * dashBoostForce, dashForceMode);
rb.AddTorque(rb.transform.right * dashBoostForce, dashForceMode);
print("dashPressed");
}
// if (Input.GetKey(KeyCode.D))
// {
// discreteActionsOut[0] = 3;
// }
// else if (Input.GetKey(KeyCode.W))
// {
// discreteActionsOut[0] = 1;
// }
// else if (Input.GetKey(KeyCode.A))
// {
// discreteActionsOut[0] = 4;
// }
// else if (Input.GetKey(KeyCode.S))
// {
// discreteActionsOut[0] = 2;
// }
}
void FixedUpdate()
{
if (spinAttack)
{
// rb.AddTorque(Vector3.up * spinAttackSpeed);
rb.angularVelocity = Vector3.up * spinAttackSpeed;
}
if (lookDir != Vector3.zero)
{
var dir = cam.transform.TransformDirection(lookDir);
dir.y = 0;
var rot = quaternion.LookRotation(dir, Vector3.up);
if (!spinAttack)
{
rb.rotation = Quaternion.Lerp(rb.rotation, rot, agentRotationSpeed * Time.deltaTime);
}
// RunOnGround(rb, dir.normalized);
// var dirToGo = rb.transform.forward;
var dirToGo = dir;
// RunOnGround(rb, dirToGo);
if (!groundCheck.isGrounded)
{
// RunInAir(rb, dirToGo.normalized);
}
else
{
RunOnGround(rb, dirToGo.normalized);
}
// rb.MoveRotation(rb.rotation * Quaternion.AngleAxis(agentRotationSpeed, rotationAxis));
}
else //is idle
{
if (groundCheck && groundCheck.isGrounded && !dashPressed)
{
AddIdleDrag(rb);
}
}
if (groundCheck && !groundCheck.isGrounded)
{
AddFallingForce(rb);
}
}
public void Jump(Rigidbody rb)
{
Vector3 velToUse = rb.velocity;
velToUse.y = agentJumpVelocity;
rb.velocity = velToUse;
}
public void RotateBody(Rigidbody rb, Vector3 rotationAxis)
{
rb.MoveRotation(rb.rotation * Quaternion.AngleAxis(agentRotationSpeed, rotationAxis));
}
public void RunOnGround(Rigidbody rb, Vector3 dir)
{
var vel = rb.velocity.magnitude;
float adjustedSpeed = Mathf.Clamp(agentRunSpeed - vel, 0, agentTerminalVel);
rb.AddForce(dir.normalized * adjustedSpeed,
runningForceMode);
}
public void RunInAir(Rigidbody rb, Vector3 dir)
{
var vel = rb.velocity.magnitude;
float adjustedSpeed = Mathf.Clamp(agentRunInAirSpeed - vel, 0, agentTerminalVel);
rb.AddForce(dir.normalized * adjustedSpeed,
runningForceMode);
}
public void AddIdleDrag(Rigidbody rb)
{
rb.velocity *= agentIdleDragVelCoeff;
}
public void AddFallingForce(Rigidbody rb)
{
rb.AddForce(
Vector3.down * agentFallingSpeed, ForceMode.Acceleration);
}
}
}

11
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AgentCubeMovement.cs.meta


fileFormatVersion: 2
guid: 0b86732e5cf714ed6ba8b18dd80f458c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

355
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AvgCenterOfMass.cs


using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Used for visualizing the average center of mass of a ragdoll
/// </summary>
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class AvgCenterOfMass : MonoBehaviour
{
[System.Serializable]
public class ShiftCom
{
public Rigidbody rb;
public Vector3 shiftComAmount;
}
/// <summary>
/// Enable to show a green spehere at the current center of mass.
/// </summary>
[Tooltip("Enable to show a green spehere at the current center of mass.")]
public bool active;
public bool showCOMGizmos = true;
public Vector3 avgCOMWorldSpace;
public Vector3 avgCOMVelocityWorldSpace;
public Vector3 previousAvgCOM;
public Color avgCOMColor = Color.green;
public Color bodyPartCOMColor = Color.yellow;
List<Rigidbody> rbList = new List<Rigidbody>();
public float totalMass;
[Tooltip("Visualize Relative Pos")]
public bool showBPPosRelToBody;
public bool useTransformPoint = true;
public bool useTransformVector;
public bool useTransformDir;
public bool showRBPos;
public bool showRelPosVectorOnly;
public bool showInverseTransformPointUnscaledRelToBody;
public bool showInverseTransformPointRelToBody;
public bool showInverseTransformVectorRelToBody;
public bool showInverseTransformDirRelToBody;
public Transform body_T;
[Tooltip("ShiftCom")] public bool updateShiftCom;
public List<ShiftCom> shiftComList = new List<ShiftCom>();
void OnEnable()
{
SetUpRigidbodies();
}
void SetUpRigidbodies()
{
rbList.Clear();
totalMass = 0;
foreach (var item in GetComponentsInChildren<Rigidbody>())
{
rbList.Add(item);
totalMass += item.mass;
}
foreach (var item in shiftComList)
{
item.rb.centerOfMass = item.shiftComAmount;
}
}
// void FixedUpdate()
// {
// if(Application.isPlaying)
// {
// avgCOMWorldSpace = Vector3.zero;
// foreach(var item in rbList)
// {
// if (item)
// {
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
// }
// //DRAW AVG GIZMOS
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
// }
// }
public Vector3 GetCoMWorldSpace()
{
Vector3 CoM = Vector3.zero;
avgCOMWorldSpace = Vector3.zero;
float c = 0f;
foreach (var item in rbList)
{
CoM += item.worldCenterOfMass * item.mass;
c += item.mass;
}
avgCOMWorldSpace = CoM / c;
avgCOMVelocityWorldSpace = (avgCOMWorldSpace - previousAvgCOM) / Time.fixedDeltaTime;
// Debug.DrawRay(avgCOMWorldSpace, avgCOMVelocityWorldSpace, Color.green,Time.fixedDeltaTime);
// Debug.DrawRay(avgCOMWorldSpace, Vector3.ProjectOnPlane( avgCOMVelocityWorldSpace, Vector3.up), Color.green,Time.fixedDeltaTime);
previousAvgCOM = avgCOMWorldSpace;
return avgCOMWorldSpace;
}
void FixedUpdate()
{
if (Application.isPlaying)
{
// avgCOMWorldSpace = Vector3.zero;
// foreach(var item in rbList)
// {
// if (item)
// {
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
// }
// //DRAW AVG GIZMOS
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
// if (active)
// {
GetCoMWorldSpace();
// }
// Vector3 CoM = Vector3.zero;
// avgCOMWorldSpace = Vector3.zero;
// float c = 0f;
//
// foreach(var item in rbList)
// {
// CoM += item.worldCenterOfMass * item.mass;
// c += item.mass;
// }
// avgCOMWorldSpace = CoM/c;
// avgCOMVelocityWorldSpace = previousAvgCOM - avgCOMWorldSpace;
// Debug.DrawRay(avgCOMWorldSpace, avgCOMVelocityWorldSpace, Color.green,Time.fixedDeltaTime);
//
// previousAvgCOM = avgCOMWorldSpace;
// // CoM /= c;
//
if (showBPPosRelToBody)
{
var pos = body_T.position;
Matrix4x4 bodyMatrix = body_T.localToWorldMatrix;
// get position from the last column
var bodyPos = new Vector3(bodyMatrix[0, 3], bodyMatrix[1, 3], bodyMatrix[2, 3]);
Debug.DrawRay(bodyPos, Vector3.up, Color.yellow, Time.fixedDeltaTime);
foreach (var rb in rbList)
{
if (showRBPos)
{
Debug.DrawRay(rb.position, Vector3.up, Color.green, Time.fixedDeltaTime);
}
if (rb.transform != body_T)
{
if (showRelPosVectorOnly)
{
var relPosVector = rb.position - body_T.position;
// Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
Debug.DrawRay(body_T.position + relPosVector, Vector3.up, Color.red, Time.fixedDeltaTime);
// Vector3 currentLocalPosRelToMatrix = bodyMatrix.inverse.MultiplyPoint(rb.position);
Vector3 currentLocalPosRelToMatrix = bodyMatrix.inverse.MultiplyVector(rb.position - bodyPos);
Debug.DrawRay(body_T.position + currentLocalPosRelToMatrix, Vector3.up, Color.green, Time.fixedDeltaTime);
}
if (showInverseTransformPointUnscaledRelToBody)
{
// Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + body_T.InverseTransformPointUnscaled(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + body_T.InverseTransformPointUnscaled(rb.transform.position), Vector3.up, Color.red,Time.fixedDeltaTime);
}
if (showInverseTransformPointRelToBody)
{
// Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red, Time.fixedDeltaTime);
}
if (showInverseTransformDirRelToBody)
{
Debug.DrawRay(body_T.InverseTransformDirection(rb.position), Vector3.up, Color.red, Time.fixedDeltaTime);
}
if (showInverseTransformVectorRelToBody)
{
Debug.DrawRay(body_T.position + body_T.InverseTransformVector(rb.position - body_T.position), Vector3.up, Color.red, Time.fixedDeltaTime);
}
// var localPosRelToBody = body.InverseTransformPoint(rb.position);
// Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + rb.transform.TransformVector(rb.transform.localPosition), Vector3.up, Color.cyan,Time.fixedDeltaTime);
// Debug.DrawRay(rb.transform.TransformPoint(rb.position), Vector3.up, Color.green,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + body_T.InverseTransformVector(rb.transform.position), Vector3.up, Color.red,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + body_T.InverseTransformDirection(rb.transform.position), Vector3.up, Color.red,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + body_T.TransformPoint(rb.transform.localPosition), Vector3.up, Color.red,Time.fixedDeltaTime);
if (useTransformPoint)
{
}
else if (useTransformVector)
{
}
else if (useTransformDir)
{
}
}
}
}
}
}
// private void OnDrawGizmosSelected()
private void OnDrawGizmos()
{
if (updateShiftCom)
{
foreach (var item in shiftComList)
{
item.rb.centerOfMass = item.shiftComAmount;
}
updateShiftCom = false;
}
if (!Application.isPlaying)
{
if (showCOMGizmos)
{
Vector3 CoM = Vector3.zero;
float c = 0f;
// avgCOMWorldSpace = Vector3.zero;
//SHOW BODY PART GIZMOS
foreach (var item in rbList)
{
// if (item)
// {
Gizmos.color = bodyPartCOMColor;
float drawCOMRadius = item.mass / totalMass;
Gizmos.DrawSphere(item.worldCenterOfMass, drawCOMRadius);
// Gizmos.DrawWireSphere(item.worldCenterOfMass, drawCOMRadius);
CoM += item.worldCenterOfMass * item.mass;
c += item.mass;
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
}
//DRAW AVG GIZMOS
avgCOMWorldSpace = CoM / c;
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
float avgCOMRadius = 0.5f; //radius of gizmo
Gizmos.color = avgCOMColor;
Gizmos.DrawWireSphere(avgCOMWorldSpace, avgCOMRadius);
}
}
else
{
if (showCOMGizmos)
{
// avgCOMWorldSpace = Vector3.zero;
//SHOW BODY PART GIZMOS
foreach (var item in rbList)
{
// if (item)
// {
Gizmos.color = bodyPartCOMColor;
float drawCOMRadius = item.mass / totalMass;
Gizmos.DrawSphere(item.worldCenterOfMass, drawCOMRadius);
// Gizmos.DrawWireSphere(item.worldCenterOfMass, drawCOMRadius);
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
}
//DRAW AVG GIZMOS
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
float avgCOMGizmoRadius = 0.5f; //radius of gizmo
Gizmos.color = avgCOMColor;
Gizmos.DrawWireSphere(avgCOMWorldSpace, avgCOMGizmoRadius);
}
}
}
// {
// if(!Application.isPlaying)
// {
// if (showCOMGizmos)
// {
// avgCOMWorldSpace = Vector3.zero;
// //SHOW BODY PART GIZMOS
// foreach(var item in rbList)
// {
// if (item)
// {
// Gizmos.color = bodyPartCOMColor;
// float drawCOMRadius = item.mass/totalMass;
// Gizmos.DrawWireSphere(item.worldCenterOfMass, drawCOMRadius);
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
// }
// //DRAW AVG GIZMOS
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
// float avgCOMRadius = 0.1f; //radius of gizmo
// Gizmos.color = avgCOMColor;
// Gizmos.DrawSphere(avgCOMWorldSpace, avgCOMRadius);
// }
// }
// else
// {
// if (showCOMGizmos)
// {
// // avgCOMWorldSpace = Vector3.zero;
// //SHOW BODY PART GIZMOS
// foreach(var item in rbList)
// {
// if (item)
// {
// Gizmos.color = bodyPartCOMColor;
// float drawCOMRadius = item.mass/totalMass;
// Gizmos.DrawWireSphere(item.worldCenterOfMass, drawCOMRadius);
// // avgCOMWorldSpace += item.worldCenterOfMass;
// }
// }
// //DRAW AVG GIZMOS
// // avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
// float avgCOMGizmoRadius = 0.1f; //radius of gizmo
// Gizmos.color = avgCOMColor;
// Gizmos.DrawSphere(avgCOMWorldSpace, avgCOMGizmoRadius);
// }
// }
// }
}

11
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/AvgCenterOfMass.cs.meta


fileFormatVersion: 2
guid: d0b24baa8ea3848dbb7585d3a0c9f225
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

135
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/CollisionCallbacks.cs


using UnityEngine;
using Random = UnityEngine.Random;
using Unity.MLAgents;
using UnityEngine.Events;
namespace Unity.MLAgentsExamples
{
/// <summary>
/// Utility class to allow target placement and collision detection with an agent
/// Add this script to the target you want the agent to touch.
/// Callbacks will be triggered any time the target is touched with a collider tagged as 'tagToDetect'
/// </summary>
public class CollisionCallbacks : MonoBehaviour
{
[Header("Collider Tag To Detect")]
public string tagToDetect = "agent"; //collider tag to detect
[Header("Target Placement")]
public float spawnRadius; //The radius in which a target can be randomly spawned.
public bool respawnIfTouched; //Should the target respawn to a different position when touched
[Header("Target Fell Protection")]
public bool respawnIfFallsOffPlatform = true; //If the target falls off the platform, reset the position.
public float fallDistance = 5; //distance below the starting height that will trigger a respawn
private Vector3 m_startingPos; //the starting position of the target
private Agent m_agentTouching; //the agent currently touching the target
[System.Serializable]
public class TriggerEvent : UnityEvent<Collider>
{
}
[Header("Trigger Callbacks")]
public TriggerEvent onTriggerEnterEvent = new TriggerEvent();
public TriggerEvent onTriggerStayEvent = new TriggerEvent();
public TriggerEvent onTriggerExitEvent = new TriggerEvent();
[System.Serializable]
public class CollisionEvent : UnityEvent<Collision>
{
}
[Header("Collision Callbacks")]
public CollisionEvent onCollisionEnterEvent = new CollisionEvent();
public CollisionEvent onCollisionStayEvent = new CollisionEvent();
public CollisionEvent onCollisionExitEvent = new CollisionEvent();
// Start is called before the first frame update
void OnEnable()
{
m_startingPos = transform.position;
if (respawnIfTouched)
{
MoveTargetToRandomPosition();
}
}
void Update()
{
if (respawnIfFallsOffPlatform)
{
if (transform.position.y < m_startingPos.y - fallDistance)
{
Debug.Log($"{transform.name} Fell Off Platform");
MoveTargetToRandomPosition();
}
}
}
/// <summary>
/// Moves target to a random position within specified radius.
/// </summary>
public void MoveTargetToRandomPosition()
{
var newTargetPos = m_startingPos + (Random.insideUnitSphere * spawnRadius);
newTargetPos.y = m_startingPos.y;
transform.position = newTargetPos;
}
private void OnCollisionEnter(Collision col)
{
if (col.transform.CompareTag(tagToDetect))
{
onCollisionEnterEvent.Invoke(col);
if (respawnIfTouched)
{
MoveTargetToRandomPosition();
}
}
}
private void OnCollisionStay(Collision col)
{
if (col.transform.CompareTag(tagToDetect))
{
onCollisionStayEvent.Invoke(col);
}
}
private void OnCollisionExit(Collision col)
{
if (col.transform.CompareTag(tagToDetect))
{
onCollisionExitEvent.Invoke(col);
}
}
private void OnTriggerEnter(Collider col)
{
if (col.CompareTag(tagToDetect))
{
onTriggerEnterEvent.Invoke(col);
}
}
private void OnTriggerStay(Collider col)
{
if (col.CompareTag(tagToDetect))
{
onTriggerStayEvent.Invoke(col);
}
}
private void OnTriggerExit(Collider col)
{
if (col.CompareTag(tagToDetect))
{
onTriggerExitEvent.Invoke(col);
}
}
}
}

11
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/CollisionCallbacks.cs.meta


fileFormatVersion: 2
guid: 2ed24226cdbc041688942d373ab17f59
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

84
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/Projectile.cs


using UnityEngine;
//This script handles the logic to determine whether an active projectile
//...should be remain active after it has been shot by an enemy
public class Projectile : MonoBehaviour
{
public float aliveTime;
[HideInInspector] public Rigidbody rb;
// private ObstacleTowerAgent agent;
public bool selfDestructNow;
public float maxTimeToLive = 3;
public float pauseCollisionDetectionWaitTime = .5f;
[HideInInspector] public ShootProjectiles projectileController;
void Awake()
{
rb = GetComponent<Rigidbody>();
// agent = FindObjectOfType<ObstacleTowerAgent>();
}
void OnEnable()
{
if (!rb)
{
rb = GetComponent<Rigidbody>();
}
aliveTime = 0;
selfDestructNow = false;
// if (agent)
// {
// agent.CompletedFloorAction += SelfDestruct;
// }
}
void OnDisable()
{
aliveTime = 0;
// if (agent)
// {
// agent.CompletedFloorAction -= SelfDestruct;
// }
}
//Turn the projectile off
void SelfDestruct()
{
gameObject.SetActive(false);
// rb.velocity = Vector3.zero;
// rb.angularVelocity = Vector3.zero;
}
void FixedUpdate()
{
// if (
// (agent && agent.IsDone()) //if the agent is done projectiles can die
// || aliveTime > maxTimeToLive //we lived too long. time to die
// )
if (aliveTime > maxTimeToLive) //we lived too long. time to die
{
selfDestructNow = true;
}
if (selfDestructNow)
{
SelfDestruct();
}
aliveTime += Time.fixedDeltaTime;
}
void OnCollisionEnter()
{
if (aliveTime > pauseCollisionDetectionWaitTime)
{
selfDestructNow = true;
}
}
}

11
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/Projectile.cs.meta


fileFormatVersion: 2
guid: 760a84ae2ce8446b28d91ff804e233cf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

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


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RandomTorqueEveryXSec : MonoBehaviour
{
public Vector3 maxTorque;
private Vector3 torqueToUse;
public float randomizeTorqueEveryXSec = 10;
public ForceMode forceMode;
private Rigidbody rb;
// Start is called before the first frame update
void OnEnable()
{
rb = GetComponent<Rigidbody>();
InvokeRepeating("SetRandomTorque", 0, randomizeTorqueEveryXSec);
}
void SetRandomTorque()
{
torqueToUse = new Vector3(Random.Range(-maxTorque.x, maxTorque.x), Random.Range(-maxTorque.y, maxTorque.y),
Random.Range(-maxTorque.z, maxTorque.z));
}
// Update is called once per frame
void FixedUpdate()
{
rb.AddRelativeTorque(torqueToUse, forceMode);
}
}

11
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/RandomTorqueEveryXSec.cs.meta


fileFormatVersion: 2
guid: 9ad9211e1047944af9e717b0f43b3f25
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

142
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/ShootProjectiles.cs


using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Logic for robot projectiles.
/// </summary>
public class ShootProjectiles : MonoBehaviour
{
public bool initialized; //has this robot been initialized
public GameObject projectilePrefab;
public int numberOfProjectilesToPool = 25;
private List<Projectile> projectilePoolList = new List<Projectile>(); //projectiles to shoot
public Transform projectileStartingPos; //the transform the projectile will originate from
public float projectileLaunchAngle = 5; //the angle at which the projectile will launch
public float shootingRate = .02f; //can shoot every shootingRate seconds. ex: .5 can shoot every .5 seconds
private float shootTimer;
public bool coolDownWait;
//for standalone projectiles
public bool autoShootEnabled;
public float autoShootDistance = 30;
public bool useStandaloneInput = false;
public KeyCode shootKey = KeyCode.J;
void Start()
{
if (!initialized)
{
Initialize();
}
}
void OnEnable()
{
if (!initialized)
{
Initialize();
}
}
void Initialize()
{
projectilePoolList.Clear(); //clear list in case it's not empty
for (var i = 0; i < numberOfProjectilesToPool; i++)
{
GameObject obj = Instantiate(projectilePrefab, transform.position, Quaternion.identity);
Projectile p = obj.GetComponent<Projectile>();
projectilePoolList.Add(p);
p.transform.position = projectileStartingPos.position;
p.projectileController = this;
p.gameObject.SetActive(false);
}
initialized = true;
}
void Update()
{
if (Input.GetKey(shootKey))
{
Shoot(projectileStartingPos.position,
projectileStartingPos.TransformPoint(Vector3.forward * autoShootDistance));
}
}
void FixedUpdate()
{
coolDownWait = shootTimer > shootingRate ? false : true;
shootTimer += Time.fixedDeltaTime;
if (autoShootEnabled)
{
Shoot(projectileStartingPos.position,
projectileStartingPos.TransformPoint(Vector3.forward * autoShootDistance));
Debug.DrawRay(projectileStartingPos.TransformPoint(Vector3.forward * autoShootDistance), Vector3.up);
}
}
public void Shoot(Vector3 startPos, Vector3 targetPos)
{
if (coolDownWait)
{
return;
}
shootTimer = 0; //reset timer
//shoot first available projectile in the pool
foreach (var item in projectilePoolList)
{
if (!item.gameObject.activeInHierarchy)
{
LaunchProjectile(item.rb, startPos, targetPos); //shoot
break;
}
}
}
public void LaunchProjectile(Rigidbody rb, Vector3 startPos, Vector3 targetPos)
{
rb.transform.position = startPos;
rb.transform.rotation = Quaternion.identity;
rb.velocity = Vector3.zero;
rb.angularVelocity = Vector3.zero;
rb.gameObject.SetActive(true);
Vector3 p = targetPos;
float gravity = Physics.gravity.magnitude;
// Selected angle in radians
float angle = projectileLaunchAngle * Mathf.Deg2Rad;
// Positions of this object and the target on the same plane
Vector3 planarTarget = new Vector3(p.x, 0, p.z);
Vector3 planarPostion = new Vector3(startPos.x, 0, startPos.z);
// Planar distance between objects
float distance = Vector3.Distance(planarTarget, planarPostion);
// Distance along the y axis between objects
float yOffset = startPos.y - p.y;
float initialVelocity = (1 / Mathf.Cos(angle)) *
Mathf.Sqrt((0.5f * gravity * Mathf.Pow(distance, 2)) /
(distance * Mathf.Tan(angle) + yOffset));
Vector3 velocity = new Vector3(0, initialVelocity * Mathf.Sin(angle), initialVelocity * Mathf.Cos(angle));
// Rotate our velocity to match the direction between the two objects
float angleBetweenObjects =
Vector3.Angle(Vector3.forward, planarTarget - planarPostion) * (p.x > startPos.x ? 1 : -1);
Vector3 finalVelocity = Quaternion.AngleAxis(angleBetweenObjects, Vector3.up) * velocity;
if (!float.IsNaN(finalVelocity.x)) //NaN checked
{
rb.velocity = finalVelocity;
}
}
}

11
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/ShootProjectiles.cs.meta


fileFormatVersion: 2
guid: f25a3868f6567418d8fca3276794e44a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存