Merge branch 'main' into karavan/nav/1
This commit is contained in:
@ -1 +1 @@
|
||||
{"count":1,"self":40.3808928,"total":40.470160799999995,"children":{"InitializeActuators":{"count":1,"self":0,"total":0,"children":null},"AgentSendState":{"count":1748,"self":0.015087699999999999,"total":0.015087699999999999,"children":null},"DecideAction":{"count":1748,"self":0.0731816,"total":0.0731816,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1649664163","unity_version":"2019.4.35f1","command_line_arguments":"D:\\Unity\\2019.4.35f1\\Editor\\Unity.exe -projectpath C:\\Users\\kiril\\real_shooter -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-kiril -hubSessionId 6a96e310-b96d-11ec-a7b5-233e78e4a355 -accessToken 8oVsqMsqrkX0YOHLVr7YCh-CV0AUIB2j_X5SC02LKv8009f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"dont touch me plz","end_time_seconds":"1649664204"}}
|
||||
{"count":1,"self":14.5494256,"total":14.5766034,"children":{"InitializeActuators":{"count":1,"self":0,"total":0,"children":null},"AgentSendState":{"count":497,"self":0.0020012999999999997,"total":0.0020012999999999997,"children":null},"DecideAction":{"count":497,"self":0.0241768,"total":0.0241768,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1649741696","unity_version":"2019.4.35f1","command_line_arguments":"D:\\Unity\\2019.4.35f1\\Editor\\Unity.exe -projectpath C:\\Users\\kiril\\real-shooter -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-kiril -hubSessionId 21e9de90-ba14-11ec-9398-079edccf5e34 -accessToken oIpf_7gKWQQRilVTeJehUsFhrxasdzsG_K3j5Swtgx0009f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"dont touch me plz","end_time_seconds":"1649741711"}}
|
2744
Assets/Prefabs/DragonFucker.prefab
generated
Normal file
2744
Assets/Prefabs/DragonFucker.prefab
generated
Normal file
File diff suppressed because it is too large
Load Diff
5
Assets/Scripts/Bots/Behaviours.meta → Assets/Prefabs/DragonFucker.prefab.meta
generated
Executable file → Normal file
5
Assets/Scripts/Bots/Behaviours.meta → Assets/Prefabs/DragonFucker.prefab.meta
generated
Executable file → Normal file
@ -1,7 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9fbac871417fccb40831b0f935247a29
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
guid: c886079c5bf3e67408d356ea1a932c5f
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
85
Assets/Prefabs/Player.prefab
generated
85
Assets/Prefabs/Player.prefab
generated
@ -100,6 +100,9 @@ GameObject:
|
||||
- component: {fileID: 4528203470625763701}
|
||||
- component: {fileID: 4528203470625763700}
|
||||
- component: {fileID: 1061105263471521090}
|
||||
- component: {fileID: 1809549200}
|
||||
- component: {fileID: 1809549201}
|
||||
- component: {fileID: 1809549212}
|
||||
m_Layer: 8
|
||||
m_Name: Player
|
||||
m_TagString: Defender
|
||||
@ -221,7 +224,7 @@ CharacterController:
|
||||
m_GameObject: {fileID: 4528203470625763699}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
serializedVersion: 2
|
||||
m_Height: 2
|
||||
m_Radius: 0.5
|
||||
@ -237,11 +240,12 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4528203470625763699}
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9826297ef4d853741b2af768441ec7f7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
input_View: {x: 0, y: 0}
|
||||
cameraHolder: {fileID: 4528203471293941515}
|
||||
feetTransform: {fileID: 4528203471164033737}
|
||||
playerSettings:
|
||||
@ -271,17 +275,18 @@ MonoBehaviour:
|
||||
gravityAmount: 0.05
|
||||
gravityMin: -3
|
||||
jumpingForce: {x: 0, y: 0, z: 0}
|
||||
playerStance: 2
|
||||
playerStance: 0
|
||||
playerStanceSmoothing: 0.2
|
||||
playerStandStance:
|
||||
CameraHeight: 0.7
|
||||
StanceCollider: {fileID: 4528203470625763702}
|
||||
playerCrouchStance:
|
||||
CameraHeight: 0
|
||||
CameraHeight: 0.3
|
||||
StanceCollider: {fileID: 4528203470625763690}
|
||||
playerProneStance:
|
||||
CameraHeight: -0.58
|
||||
StanceCollider: {fileID: 4528203470625763703}
|
||||
currentWeapon: {fileID: 0}
|
||||
--- !u!114 &1061105263471521090
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -294,7 +299,77 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: a6f2a081cfc8c4b4bb6864331109d147, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
LastTimeHit: 0
|
||||
agentParameters:
|
||||
maxStep: 0
|
||||
hasUpgradedFromAgentParameters: 1
|
||||
MaxStep: 10
|
||||
moveController: {fileID: 1809549200}
|
||||
--- !u!114 &1809549200
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4528203470625763699}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d3ebcf807a37f344998fd648dfc9376d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
mapManager: {fileID: 0}
|
||||
navMeshAgent: {fileID: 1809549201}
|
||||
--- !u!195 &1809549201
|
||||
NavMeshAgent:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4528203470625763699}
|
||||
m_Enabled: 1
|
||||
m_AgentTypeID: 0
|
||||
m_Radius: 0.5
|
||||
m_Speed: 3.5
|
||||
m_Acceleration: 8
|
||||
avoidancePriority: 50
|
||||
m_AngularSpeed: 120
|
||||
m_StoppingDistance: 0
|
||||
m_AutoTraverseOffMeshLink: 1
|
||||
m_AutoBraking: 1
|
||||
m_AutoRepath: 1
|
||||
m_Height: 2
|
||||
m_BaseOffset: 1
|
||||
m_WalkableMask: 4294967295
|
||||
m_ObstacleAvoidanceType: 4
|
||||
--- !u!114 &1809549212
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4528203470625763699}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5d1c4e0b1822b495aa52bc52839ecb30, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_BrainParameters:
|
||||
VectorObservationSize: 4
|
||||
NumStackedVectorObservations: 1
|
||||
m_ActionSpec:
|
||||
m_NumContinuousActions: 0
|
||||
BranchSizes: 01000000
|
||||
VectorActionSize: 01000000
|
||||
VectorActionDescriptions: []
|
||||
VectorActionSpaceType: 0
|
||||
hasUpgradedBrainParametersWithActionSpec: 1
|
||||
m_Model: {fileID: 0}
|
||||
m_InferenceDevice: 3
|
||||
m_BehaviorType: 1
|
||||
m_BehaviorName: Defender Behaviour
|
||||
TeamId: 0
|
||||
m_UseChildSensors: 0
|
||||
m_UseChildActuators: 1
|
||||
m_ObservableAttributeHandling: 2
|
||||
--- !u!1 &4528203471164033736
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
508
Assets/Scenes/Greatest_map_ever/Greatest_map_ever.unity
generated
508
Assets/Scenes/Greatest_map_ever/Greatest_map_ever.unity
generated
@ -121,59 +121,6 @@ NavMeshSettings:
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 23800000, guid: 305bb221606d7a748acca94156e2d347, type: 2}
|
||||
--- !u!1 &120549363
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 120549365}
|
||||
- component: {fileID: 120549364}
|
||||
m_Layer: 0
|
||||
m_Name: NavMeshAgent
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!195 &120549364
|
||||
NavMeshAgent:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 120549363}
|
||||
m_Enabled: 1
|
||||
m_AgentTypeID: 0
|
||||
m_Radius: 0.5
|
||||
m_Speed: 3.5
|
||||
m_Acceleration: 8
|
||||
avoidancePriority: 50
|
||||
m_AngularSpeed: 120
|
||||
m_StoppingDistance: 0
|
||||
m_AutoTraverseOffMeshLink: 1
|
||||
m_AutoBraking: 1
|
||||
m_AutoRepath: 1
|
||||
m_Height: 2
|
||||
m_BaseOffset: 0
|
||||
m_WalkableMask: 4294967295
|
||||
m_ObstacleAvoidanceType: 4
|
||||
--- !u!4 &120549365
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 120549363}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 19.553204, y: 6.782543, z: -39.4}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &129751243
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1429,7 +1376,7 @@ GameObject:
|
||||
- component: {fileID: 1116745544}
|
||||
m_Layer: 0
|
||||
m_Name: navpoint2
|
||||
m_TagString: Untagged
|
||||
m_TagString: Point
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@ -1607,7 +1554,7 @@ Mesh:
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: pb_Mesh32196
|
||||
m_Name: pb_Mesh17416
|
||||
serializedVersion: 10
|
||||
m_SubMeshes:
|
||||
- serializedVersion: 2
|
||||
@ -1862,7 +1809,7 @@ GameObject:
|
||||
- component: {fileID: 1345085342}
|
||||
m_Layer: 0
|
||||
m_Name: navpoint1
|
||||
m_TagString: Untagged
|
||||
m_TagString: Point
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@ -2695,7 +2642,7 @@ GameObject:
|
||||
- component: {fileID: 2004854094}
|
||||
m_Layer: 0
|
||||
m_Name: navpoint3
|
||||
m_TagString: Untagged
|
||||
m_TagString: Point
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
@ -2768,7 +2715,7 @@ Transform:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2004854093}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 47.446796, y: -5.782543, z: -25.400002}
|
||||
m_LocalPosition: {x: 30.59, y: -5.782543, z: -1.58}
|
||||
m_LocalScale: {x: 1.4367, y: 1.4367, z: 1.4367}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2060099472}
|
||||
@ -2930,6 +2877,88 @@ MeshFilter:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2114154251}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!114 &5078004101906046130
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040873181315}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a6f2a081cfc8c4b4bb6864331109d147, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
agentParameters:
|
||||
maxStep: 0
|
||||
hasUpgradedFromAgentParameters: 1
|
||||
MaxStep: 100
|
||||
moveController: {fileID: 5242608118223468128}
|
||||
--- !u!114 &5242608118223468128
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040873181315}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d3ebcf807a37f344998fd648dfc9376d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
navMeshAgent: {fileID: 5242608118223468129}
|
||||
--- !u!195 &5242608118223468129
|
||||
NavMeshAgent:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040873181315}
|
||||
m_Enabled: 1
|
||||
m_AgentTypeID: 0
|
||||
m_Radius: 0.5
|
||||
m_Speed: 3.5
|
||||
m_Acceleration: 8
|
||||
avoidancePriority: 50
|
||||
m_AngularSpeed: 120
|
||||
m_StoppingDistance: 0
|
||||
m_AutoTraverseOffMeshLink: 1
|
||||
m_AutoBraking: 1
|
||||
m_AutoRepath: 1
|
||||
m_Height: 2
|
||||
m_BaseOffset: 1
|
||||
m_WalkableMask: 4294967295
|
||||
m_ObstacleAvoidanceType: 4
|
||||
--- !u!114 &5242608118223468140
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040873181315}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5d1c4e0b1822b495aa52bc52839ecb30, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_BrainParameters:
|
||||
VectorObservationSize: 4
|
||||
NumStackedVectorObservations: 1
|
||||
m_ActionSpec:
|
||||
m_NumContinuousActions: 0
|
||||
BranchSizes: 01000000
|
||||
VectorActionSize: 01000000
|
||||
VectorActionDescriptions: []
|
||||
VectorActionSpaceType: 0
|
||||
hasUpgradedBrainParametersWithActionSpec: 1
|
||||
m_Model: {fileID: 0}
|
||||
m_InferenceDevice: 0
|
||||
m_BehaviorType: 1
|
||||
m_BehaviorName: NPC
|
||||
TeamId: 0
|
||||
m_UseChildSensors: 1
|
||||
m_UseChildActuators: 1
|
||||
m_ObservableAttributeHandling: 0
|
||||
--- !u!1001 &6818223692685937217
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -3004,3 +3033,366 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 1685c1d9ce4ab174f95c646b1826010b, type: 3}
|
||||
--- !u!23 &8333476723876163232
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040873181315}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
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 &8509012040201336570
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8509012040201336571}
|
||||
m_Layer: 8
|
||||
m_Name: CameraHolder
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8509012040201336571
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040201336570}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.7, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 8509012041069629704}
|
||||
m_Father: {fileID: 8509012040873181337}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &8509012040340093752
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8509012040340093753}
|
||||
m_Layer: 8
|
||||
m_Name: FeetTransform
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8509012040340093753
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040340093752}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -1, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 8509012040873181337}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &8509012040873181315
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8509012040873181337}
|
||||
- component: {fileID: 8509012040873181336}
|
||||
- component: {fileID: 8333476723876163232}
|
||||
- component: {fileID: 8509012040873181318}
|
||||
- component: {fileID: 8509012040873181338}
|
||||
- component: {fileID: 8509012040873181319}
|
||||
- component: {fileID: 8509012040873181317}
|
||||
- component: {fileID: 8509012040873181316}
|
||||
- component: {fileID: 5078004101906046130}
|
||||
- component: {fileID: 5242608118223468128}
|
||||
- component: {fileID: 5242608118223468129}
|
||||
- component: {fileID: 5242608118223468140}
|
||||
- component: {fileID: 8509012040873181320}
|
||||
m_Layer: 8
|
||||
m_Name: 'Player '
|
||||
m_TagString: Defender
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &8509012040873181316
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040873181315}
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9826297ef4d853741b2af768441ec7f7, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
input_View: {x: 0, y: 0}
|
||||
cameraHolder: {fileID: 8509012040201336571}
|
||||
feetTransform: {fileID: 8509012040340093753}
|
||||
playerSettings:
|
||||
ViewXSensetivity: 20
|
||||
ViewYSensetivity: 20
|
||||
ViewXInverted: 0
|
||||
ViewYInverted: 0
|
||||
SprintingHold: 0
|
||||
MovementSmoothing: 0
|
||||
RunningForwardSpeed: 10
|
||||
RunningStrafeSpeed: 6
|
||||
WalkingForwardSpeed: 4
|
||||
WalkingBackwardSpeed: 2
|
||||
WalkingStrafeSpeed: 3
|
||||
JumpingHeight: 6
|
||||
JumpingFalloff: 1
|
||||
FallingSmoothing: 0
|
||||
SpeedEffector: 1
|
||||
CrouchSpeedEffector: 0
|
||||
ProneSpeedEffector: 0
|
||||
FallingSpeedEffector: 0
|
||||
ViewClampYMin: -70
|
||||
ViewClampYMax: 80
|
||||
playerMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 55
|
||||
gravityAmount: 0.05
|
||||
gravityMin: -3
|
||||
jumpingForce: {x: 0, y: 0, z: 0}
|
||||
playerStance: 0
|
||||
playerStanceSmoothing: 0.2
|
||||
playerStandStance:
|
||||
CameraHeight: 0.7
|
||||
StanceCollider: {fileID: 8509012040873181318}
|
||||
playerCrouchStance:
|
||||
CameraHeight: 0.3
|
||||
StanceCollider: {fileID: 8509012040873181338}
|
||||
playerProneStance:
|
||||
CameraHeight: -0.58
|
||||
StanceCollider: {fileID: 8509012040873181319}
|
||||
currentWeapon: {fileID: 0}
|
||||
--- !u!143 &8509012040873181317
|
||||
CharacterController:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040873181315}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 0
|
||||
serializedVersion: 2
|
||||
m_Height: 2
|
||||
m_Radius: 0.5
|
||||
m_SlopeLimit: 45
|
||||
m_StepOffset: 0.3
|
||||
m_SkinWidth: 0.08
|
||||
m_MinMoveDistance: 0.001
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!136 &8509012040873181318
|
||||
CapsuleCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040873181315}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 0
|
||||
m_Radius: 0.3
|
||||
m_Height: 2
|
||||
m_Direction: 1
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
--- !u!136 &8509012040873181319
|
||||
CapsuleCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040873181315}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 1
|
||||
m_Radius: 0.3
|
||||
m_Height: 0.8
|
||||
m_Direction: 1
|
||||
m_Center: {x: 0, y: -0.6, z: 0}
|
||||
--- !u!114 &8509012040873181320
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040873181315}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3a5c9d521e5ef4759a8246a07d52221e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
DecisionPeriod: 1
|
||||
TakeActionsBetweenDecisions: 0
|
||||
--- !u!33 &8509012040873181336
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040873181315}
|
||||
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &8509012040873181337
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040873181315}
|
||||
m_LocalRotation: {x: -0, y: 0.6820348, z: -0, w: 0.7313197}
|
||||
m_LocalPosition: {x: 40.54, y: 1, z: -15.91}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 8509012040201336571}
|
||||
- {fileID: 8509012040340093753}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 86.006004, z: 0}
|
||||
--- !u!136 &8509012040873181338
|
||||
CapsuleCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012040873181315}
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_Enabled: 0
|
||||
m_Radius: 0.3
|
||||
m_Height: 1.3
|
||||
m_Direction: 1
|
||||
m_Center: {x: 0, y: -0.35, z: 0}
|
||||
--- !u!4 &8509012041069629704
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012041069629749}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.734, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 8509012040201336571}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &8509012041069629749
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8509012041069629704}
|
||||
- component: {fileID: 8509012041069629751}
|
||||
- component: {fileID: 8509012041069629750}
|
||||
m_Layer: 8
|
||||
m_Name: Camera
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &8509012041069629750
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012041069629749}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &8509012041069629751
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8509012041069629749}
|
||||
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_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
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
|
||||
|
2
Assets/Scenes/dont touch me plz.unity
generated
2
Assets/Scenes/dont touch me plz.unity
generated
@ -404,7 +404,7 @@ PrefabInstance:
|
||||
- target: {fileID: 5245491127989480103, guid: 80f6c1c85e5daed4c96c70205ed5503d,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 28.21
|
||||
value: 32.94
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5245491127989480103, guid: 80f6c1c85e5daed4c96c70205ed5503d,
|
||||
type: 3}
|
||||
|
@ -1,17 +0,0 @@
|
||||
using Unity;
|
||||
using UnityEngine;
|
||||
public abstract class BaseBehaviour
|
||||
{
|
||||
protected NPC thisNPC;
|
||||
protected IDoActivity DoActivity;
|
||||
|
||||
protected BaseBehaviour(NPC npc)
|
||||
{
|
||||
thisNPC = npc;
|
||||
}
|
||||
|
||||
public void DoAction()
|
||||
{
|
||||
DoActivity?.DoActivity();
|
||||
}
|
||||
}
|
11
Assets/Scripts/Bots/Behaviours/BaseBehaviour.cs.meta
generated
11
Assets/Scripts/Bots/Behaviours/BaseBehaviour.cs.meta
generated
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 60bdb2d866ca9324cbe3639e7c47ae23
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 362d340e6754883459f3dc89c9ddc476
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
public class DumbAttacker : BaseBehaviour
|
||||
{
|
||||
public DumbAttacker(NPC npc) : base(npc)
|
||||
{
|
||||
DoActivity = new DumbAttackerBehaviour();
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 138d13d4fe8a06444acb1da6bfc55aa7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,7 +0,0 @@
|
||||
public class DumbDefender : BaseBehaviour
|
||||
{
|
||||
public DumbDefender(NPC npc) : base(npc)
|
||||
{
|
||||
DoActivity = new DumbDefenderBehaviour();
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 64552bae354dc614d8012f07511a51e8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,7 +0,0 @@
|
||||
public class Human : BaseBehaviour
|
||||
{
|
||||
public Human(NPC npc) : base(npc)
|
||||
{
|
||||
DoActivity = new HumanBehaviour();
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59d3d253756147e469e418971625a04c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93364cc95c8c9764e83d70fcce9da482
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,9 +0,0 @@
|
||||
using UnityEngine;
|
||||
class DumbAttackerBehaviour : IDoActivity
|
||||
{
|
||||
public void DoActivity()
|
||||
{
|
||||
Debug.Log("I do attackers things!");
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2cc7b0640887454e96d42f6bd066750
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,9 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
class DumbDefenderBehaviour : IDoActivity
|
||||
{
|
||||
public void DoActivity()
|
||||
{
|
||||
Debug.Log("I do defenders things!");
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 27106553be3f26b4da5220e39a3098c3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,8 +0,0 @@
|
||||
class HumanBehaviour : IDoActivity
|
||||
{
|
||||
public void DoActivity()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d207d14aaf634504e84f3e3bd8b52428
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,4 +0,0 @@
|
||||
public interface IDoActivity
|
||||
{
|
||||
void DoActivity();
|
||||
}
|
11
Assets/Scripts/Bots/Behaviours/IDoActivity.cs.meta
generated
11
Assets/Scripts/Bots/Behaviours/IDoActivity.cs.meta
generated
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8e7275817852aa941963daa476581224
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/Scripts/Bots/CharacterFactory.meta
generated
8
Assets/Scripts/Bots/CharacterFactory.meta
generated
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93133f9c3db1b944d9120ea789988f9b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,45 +0,0 @@
|
||||
public abstract class AbstractCharacterFactory
|
||||
{
|
||||
protected IDoActivity behaviour;
|
||||
protected AbstractCharacterFactory() { }
|
||||
public abstract BaseBehaviour CreateCharacterBehaviour(NPC npc);
|
||||
}
|
||||
|
||||
public class DumbDefenderFactory : AbstractCharacterFactory
|
||||
{
|
||||
public DumbDefenderFactory()
|
||||
{
|
||||
behaviour = new DumbDefenderBehaviour();
|
||||
}
|
||||
|
||||
public override BaseBehaviour CreateCharacterBehaviour(NPC npc)
|
||||
{
|
||||
return new DumbDefender(npc);
|
||||
}
|
||||
}
|
||||
|
||||
public class DumbAttackerFactory : AbstractCharacterFactory
|
||||
{
|
||||
public DumbAttackerFactory()
|
||||
{
|
||||
behaviour = new DumbAttackerBehaviour();
|
||||
}
|
||||
|
||||
public override BaseBehaviour CreateCharacterBehaviour(NPC npc)
|
||||
{
|
||||
return new DumbAttacker(npc);
|
||||
}
|
||||
}
|
||||
|
||||
public class HumanFactory : AbstractCharacterFactory
|
||||
{
|
||||
public HumanFactory()
|
||||
{
|
||||
behaviour = new HumanBehaviour();
|
||||
}
|
||||
|
||||
public override BaseBehaviour CreateCharacterBehaviour(NPC npc)
|
||||
{
|
||||
return new Human(npc);
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f973f98c4f699745a605d09e2c1e46e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,55 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class CharacterSpawner : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject botPrefab;
|
||||
[SerializeField] private List<NavPoint> defendersSpawnPoints;
|
||||
[SerializeField] private List<NavPoint> attackersSpawnPoints;
|
||||
private static Dictionary<(TypeAI, Team), Func<NPC, BaseBehaviour>> behaviourDictionary;
|
||||
private static System.Random random;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
behaviourDictionary = new Dictionary<(TypeAI, Team), Func<NPC, BaseBehaviour>>()
|
||||
{
|
||||
{ (TypeAI.DumbAlgorithm, Team.Attackers), new Func<NPC,BaseBehaviour>( npc => new DumbAttacker(npc))},
|
||||
{ (TypeAI.DumbAlgorithm, Team.Defenders), new Func<NPC,BaseBehaviour>( npc => new DumbDefender(npc)) },
|
||||
{ (TypeAI.HumanAI, Team.Defenders), new Func<NPC,BaseBehaviour>( npc => new Human(npc))},
|
||||
{ (TypeAI.HumanAI, Team.Attackers), new Func<NPC,BaseBehaviour>( npc => new Human(npc))},
|
||||
//And Other behaviours
|
||||
};
|
||||
|
||||
if (SettingsReader.Instance.GetSettings.hasHumanAttacker && SettingsReader.Instance.GetSettings.hasHumanDefender)
|
||||
throw new System.Exception("Not allowed to have two players");
|
||||
else if (SettingsReader.Instance.GetSettings.hasHumanAttacker == true)
|
||||
{
|
||||
spawnCharacter(behaviourDictionary[(TypeAI.HumanAI, Team.Attackers)], Team.Attackers);
|
||||
}
|
||||
else if (SettingsReader.Instance.GetSettings.hasHumanDefender == true)
|
||||
{
|
||||
spawnCharacter(behaviourDictionary[(TypeAI.HumanAI, Team.Defenders)], Team.Defenders);
|
||||
}
|
||||
|
||||
for (int i = 0; i < SettingsReader.Instance.GetSettings.numOfAttackers - (SettingsReader.Instance.GetSettings.hasHumanAttacker ? 1 : 0); i++)
|
||||
{
|
||||
spawnCharacter(behaviourDictionary[(SettingsReader.Instance.GetSettings.atcTeamAI, Team.Attackers)], Team.Attackers);
|
||||
}
|
||||
for (int i = 0; i < SettingsReader.Instance.GetSettings.numOfAttackers - (SettingsReader.Instance.GetSettings.hasHumanDefender ? 1 : 0); i++)
|
||||
{
|
||||
spawnCharacter(behaviourDictionary[(SettingsReader.Instance.GetSettings.defTeamAI, Team.Defenders)], Team.Defenders);
|
||||
}
|
||||
}
|
||||
|
||||
private void spawnCharacter(Func<NPC, BaseBehaviour> behaviourFunc, Team team)
|
||||
{
|
||||
var spawnPoint = team == Team.Defenders ?
|
||||
defendersSpawnPoints[random.Next(0, defendersSpawnPoints.Count)].position :
|
||||
attackersSpawnPoints[random.Next(0, attackersSpawnPoints.Count)].position;
|
||||
var entity = Instantiate(botPrefab, spawnPoint, Quaternion.identity);
|
||||
var npc = entity.GetComponent<NPC>();
|
||||
npc.SetBehaviour(behaviourFunc(npc));
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 672f5411fc3ccb74d8a17a6efdee9df4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,39 +1,71 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class CharacterCondition : MonoBehaviour
|
||||
public enum NPCState
|
||||
{
|
||||
public event Action<object> OnKilledEvent;
|
||||
public event Action<int> OnDamageHealthTakenEvent;
|
||||
public event Action<int> OnDamageArmourTakenEvent;
|
||||
public event Action<int> OnAmmunitionTakenEvent;
|
||||
|
||||
[SerializeField] private int HealthPoints;
|
||||
[SerializeField] private int ArmourPoints;
|
||||
[SerializeField] private int Ammunition;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void GetDamage(float damage)
|
||||
{
|
||||
HealthPoints -= Mathf.RoundToInt(damage * (1 - ArmourPoints * 0.5f));
|
||||
ArmourPoints -= Mathf.RoundToInt(Mathf.Sqrt(damage) * 5);
|
||||
|
||||
OnDamageHealthTakenEvent?.Invoke(HealthPoints);
|
||||
OnDamageArmourTakenEvent?.Invoke(ArmourPoints);
|
||||
if (HealthPoints < 0)
|
||||
OnKilledEvent?.Invoke(gameObject);
|
||||
}
|
||||
public void GiveHealth(int health) => HealthPoints = Mathf.Clamp(health + HealthPoints, 0, 100);
|
||||
public void SetHealth(int health) => HealthPoints = Mathf.Clamp(health, 0, 100);
|
||||
public void GiveArmour(int armour) => ArmourPoints = Mathf.Clamp(armour + ArmourPoints, 0, 100);
|
||||
public void SetArmour(int armour) => ArmourPoints = Mathf.Clamp(armour, 0, 100);
|
||||
public void TakeAmmo(int ammo)
|
||||
{
|
||||
Ammunition += ammo;
|
||||
OnAmmunitionTakenEvent?.Invoke(Ammunition);
|
||||
}
|
||||
InCover,
|
||||
InBlancPoint,
|
||||
InRunning,
|
||||
}
|
||||
|
||||
public class CharacterCondition
|
||||
{
|
||||
public event Action<int> OnChangeHealthEvent;
|
||||
public event Action<int> OnChangeArmourEvent;
|
||||
public event Action<int> OnChangeAmmunitionEvent;
|
||||
|
||||
private int health;
|
||||
public int HealthPoints
|
||||
{
|
||||
get
|
||||
{
|
||||
return health;
|
||||
}
|
||||
private set
|
||||
{
|
||||
health = value;
|
||||
OnChangeHealthEvent?.Invoke(value);
|
||||
}
|
||||
}
|
||||
private int armour;
|
||||
public int ArmourPoints
|
||||
{
|
||||
get
|
||||
{
|
||||
return armour;
|
||||
}
|
||||
private set
|
||||
{
|
||||
armour = value;
|
||||
OnChangeArmourEvent?.Invoke(value);
|
||||
}
|
||||
}
|
||||
private int ammo;
|
||||
public int Ammunition
|
||||
{
|
||||
get
|
||||
{
|
||||
return ammo;
|
||||
}
|
||||
private set
|
||||
{
|
||||
ammo = value;
|
||||
OnChangeAmmunitionEvent?.Invoke(value);
|
||||
}
|
||||
}
|
||||
|
||||
[HideInInspector]
|
||||
public NPCState npcState { get; private set; }
|
||||
|
||||
public CharacterCondition()
|
||||
{
|
||||
var settings = SettingsReader.Instance.GetSettings;
|
||||
ammo = settings.maxAmmo;
|
||||
health = settings.maxHealth;
|
||||
armour = settings.maxArmour;
|
||||
}
|
||||
|
||||
public void GiveHealth(int health) => HealthPoints = Mathf.Clamp(health + HealthPoints, 0, 100);
|
||||
public void GiveArmour(int armour) => ArmourPoints = Mathf.Clamp(armour + ArmourPoints, 0, 100);
|
||||
public void TakeAmmo(int ammo) => Ammunition += ammo;
|
||||
}
|
@ -7,7 +7,6 @@ using UnityEngine.AI;
|
||||
public class MovementController : MonoBehaviour
|
||||
{
|
||||
public NavPoint currentPosition { get; private set; }
|
||||
[SerializeField] private MapManager mapManager;
|
||||
[SerializeField] private NavMeshAgent navMeshAgent;
|
||||
|
||||
private void Start()
|
||||
@ -21,18 +20,21 @@ public class MovementController : MonoBehaviour
|
||||
goToNextNavPoint(pointCandidate);
|
||||
}
|
||||
|
||||
public void MoveToRandomPoint()
|
||||
{
|
||||
Debug.Log(MapManager.navPoints == null);
|
||||
goToNextNavPoint(MapManager.navPoints[Random.Range(0, MapManager.navPoints.Count)]);
|
||||
}
|
||||
|
||||
// todo внутри сенсора передавать в mlagents как variable length observations: https://github.com/Unity-Technologies/ml-agents/blob/main/docs/Learning-Environment-Design-Agents.md#variable-length-observations
|
||||
private NavPoint getPointCandidate()
|
||||
{
|
||||
var NavPointsPositions = mapManager.navPoints
|
||||
var NavPointsPositions = MapManager.navPoints
|
||||
.Select(point => point.transform.position)
|
||||
.Where(point => (currentPosition.transform.position - point).magnitude <= SettingsReader.Instance.GetSettings.movementSpeed)
|
||||
.ToList();
|
||||
//TODO AI
|
||||
return null;
|
||||
}
|
||||
|
||||
private void goToNextNavPoint(NavPoint destination) =>
|
||||
public void goToNextNavPoint(NavPoint destination) =>
|
||||
navMeshAgent.SetDestination(destination.transform.position);
|
||||
}
|
||||
|
@ -1,37 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Unity.MLAgents;
|
||||
using Unity.MLAgents.Sensors;
|
||||
using Unity.MLAgents.Actuators;
|
||||
|
||||
[RequireComponent(typeof(MovementController))]
|
||||
public class NPC : Agent
|
||||
{
|
||||
public float LastTimeHit;
|
||||
private BaseBehaviour NPCBehaviour;
|
||||
public List<Action> ActionList;
|
||||
|
||||
[SerializeField]
|
||||
private List<ISensor> SensorList; // todo тут интерфейс должен быть наш
|
||||
|
||||
public void SetBehaviour(BaseBehaviour behaviour) => NPCBehaviour = behaviour;
|
||||
public Team Team { get; set; }
|
||||
|
||||
[HideInInspector]
|
||||
private float LastTimeHit;
|
||||
public CharacterCondition Condition;
|
||||
|
||||
public MovementController moveController;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Condition = new CharacterCondition();
|
||||
moveController = gameObject.GetComponent<MovementController>();
|
||||
}
|
||||
|
||||
public override void OnEpisodeBegin()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void CollectObservations(VectorSensor sensor)
|
||||
{
|
||||
// Target and Agent positions
|
||||
foreach (var _sensor in SensorList)
|
||||
sensor.AddObservation(Condition.HealthPoints);
|
||||
sensor.AddObservation(Condition.ArmourPoints);
|
||||
sensor.AddObservation(Condition.Ammunition);
|
||||
sensor.AddObservation((int)Condition.npcState);
|
||||
}
|
||||
|
||||
public override void Heuristic(in ActionBuffers actionsOut)
|
||||
{
|
||||
sensor.AddObservation(1); // todo
|
||||
// sensor.AddObservation(_sensor.GetValue());
|
||||
var discreteActionsOut = actionsOut.DiscreteActions;
|
||||
if (Input.GetKeyDown(KeyCode.W))
|
||||
{
|
||||
discreteActionsOut[0] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
public override void OnActionReceived(ActionBuffers actions)
|
||||
{
|
||||
//NPCBehaviour.DoAction();
|
||||
if (actions.DiscreteActions[0] == 1)
|
||||
moveController.MoveToRandomPoint();
|
||||
}
|
||||
|
||||
public event Action<object> OnKilledEvent;
|
||||
public void GetDamage(float damage)
|
||||
{
|
||||
Condition.GiveHealth(-Mathf.RoundToInt(damage * (1 - Condition.ArmourPoints * 0.5f)));
|
||||
Condition.GiveArmour(-Mathf.RoundToInt(Mathf.Sqrt(damage) * 5));
|
||||
|
||||
if (Condition.HealthPoints < 0)
|
||||
OnKilledEvent?.Invoke(this);
|
||||
}
|
||||
}
|
||||
|
@ -3,11 +3,15 @@ using UnityEngine;
|
||||
|
||||
public class MapManager : MonoBehaviour
|
||||
{
|
||||
public List<NavPoint> navPoints { get; private set; }
|
||||
public static List<NavPoint> navPoints { get; private set; }
|
||||
private void Start()
|
||||
{
|
||||
navPoints = new List<NavPoint>();
|
||||
var navPointsGameObj = GameObject.FindGameObjectsWithTag("Point");
|
||||
foreach (var gameobj in navPointsGameObj)
|
||||
{
|
||||
Debug.Log(" a ");
|
||||
navPoints.Add(gameobj.GetComponent<NavPoint>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ public class FlagZone : MonoBehaviour
|
||||
{
|
||||
|
||||
timeForWin = SettingsReader.Instance.GetSettings.timeToWin;
|
||||
Debug.Log("32");
|
||||
TimeStayAttackers = 0;
|
||||
TimeStayDefenders = 0;
|
||||
occupAttackers = 0;
|
||||
|
@ -1,18 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Movement : MonoBehaviour
|
||||
{
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
11
Assets/Scripts/Misc/Movement.cs.meta
generated
11
Assets/Scripts/Misc/Movement.cs.meta
generated
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88ea68cab52d1a64c8fc9976e156a380
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -3,6 +3,8 @@
|
||||
[CreateAssetMenu(fileName ="Game Settings", menuName = "Game/Settings", order = 51)]
|
||||
public class Settings : ScriptableObject
|
||||
{
|
||||
public bool isTesting;
|
||||
|
||||
public float timeToWin;
|
||||
public float timeOut;
|
||||
|
||||
@ -21,4 +23,8 @@ public class Settings : ScriptableObject
|
||||
public int armourPickupAmount;
|
||||
public int ammunitionPickupAmount;
|
||||
public int pickupsAmount;
|
||||
|
||||
public int maxHealth;
|
||||
public int maxArmour;
|
||||
public int maxAmmo;
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ public class SettingsReader : MonoBehaviour
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Debug.Log("init");
|
||||
instance = this;
|
||||
}
|
||||
|
||||
|
@ -1,5 +0,0 @@
|
||||
public interface ISensor<T>
|
||||
{
|
||||
T GetValue();
|
||||
SensorType GetSensorType();
|
||||
}
|
4
Assets/Scripts/Sensors/Sensors.cs
Normal file
4
Assets/Scripts/Sensors/Sensors.cs
Normal file
@ -0,0 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using Unity.MLAgents.Sensors;
|
||||
|
||||
|
0
Assets/Scripts/Sensors/ISensor.cs.meta → Assets/Scripts/Sensors/Sensors.cs.meta
generated
Executable file → Normal file
0
Assets/Scripts/Sensors/ISensor.cs.meta → Assets/Scripts/Sensors/Sensors.cs.meta
generated
Executable file → Normal file
@ -740,7 +740,3 @@ public abstract class DictionaryDrawer<TK, TV> : PropertyDrawer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable] public class DictionaryOfTeamsAndNavPoints : SerializableDictionary<Team, NavPoint> { }
|
||||
[CustomPropertyDrawer(typeof(DictionaryOfTeamsAndNavPoints))]
|
||||
public class DictionaryOfTeamsAndNavPointsDrawer : DictionaryDrawer<Team, NavPoint> { }
|
4
Assets/Settings/Game Settings.asset
generated
4
Assets/Settings/Game Settings.asset
generated
@ -12,6 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: e2c47233b9062c84482336b145c6891b, type: 3}
|
||||
m_Name: Game Settings
|
||||
m_EditorClassIdentifier:
|
||||
isTesting: 1
|
||||
timeToWin: 5
|
||||
timeOut: 1600
|
||||
movementDistance: 50
|
||||
@ -26,3 +27,6 @@ MonoBehaviour:
|
||||
armourPickupAmount: 50
|
||||
ammunitionPickupAmount: 120
|
||||
pickupsAmount: 2
|
||||
maxHealth: 0
|
||||
maxArmour: 0
|
||||
maxAmmo: 0
|
||||
|
2
ProjectSettings/ProjectSettings.asset
generated
2
ProjectSettings/ProjectSettings.asset
generated
@ -712,5 +712,5 @@ PlayerSettings:
|
||||
organizationId: unity_9asvqbkpr8e5lq
|
||||
cloudEnabled: 0
|
||||
enableNativePlatformBackendsForNewInputSystem: 1
|
||||
disableOldInputManagerSupport: 1
|
||||
disableOldInputManagerSupport: 0
|
||||
legacyClampBlendShapeWeights: 0
|
||||
|
@ -1,2 +1,2 @@
|
||||
m_EditorVersion: 2019.4.36f1
|
||||
m_EditorVersionWithRevision: 2019.4.36f1 (660c164b2fc5)
|
||||
m_EditorVersion: 2019.4.35f1
|
||||
m_EditorVersionWithRevision: 2019.4.35f1 (0462406dff2e)
|
||||
|
Reference in New Issue
Block a user