Merge pull request 'krazerleo/core/1' (#2) from krazerleo/core/1 into main
Reviewed-on: #2 Reviewed-by: gav <a@a.aa>
This commit is contained in:
247
Assets/Prefabs/Bot.prefab
generated
247
Assets/Prefabs/Bot.prefab
generated
@ -1,6 +1,6 @@
|
|||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
--- !u!1 &2988578997639256874
|
--- !u!1 &6171680323407988095
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -8,52 +8,86 @@ GameObject:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 2988578997639256870}
|
- component: {fileID: 6171680323407988094}
|
||||||
- component: {fileID: 2988578997639256869}
|
m_Layer: 8
|
||||||
- component: {fileID: 2988578997639256868}
|
m_Name: FeetTransform
|
||||||
- component: {fileID: 2988578997639256875}
|
|
||||||
- component: {fileID: 5447337162552783061}
|
|
||||||
- component: {fileID: 7805954453358028498}
|
|
||||||
- component: {fileID: 2676446634235362783}
|
|
||||||
- component: {fileID: 8656710265340117963}
|
|
||||||
- component: {fileID: 778652956973742106}
|
|
||||||
- component: {fileID: 1208561866453126566}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: Bot
|
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 1
|
||||||
--- !u!4 &2988578997639256870
|
--- !u!4 &6171680323407988094
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2988578997639256874}
|
m_GameObject: {fileID: 6171680323407988095}
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 28.310326, y: 13.98, z: 46.45}
|
m_LocalPosition: {x: 0, y: -1, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 6171680323948707550}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!33 &2988578997639256869
|
--- !u!1 &6171680323948707524
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 6171680323948707550}
|
||||||
|
- component: {fileID: 6171680323948707551}
|
||||||
|
- component: {fileID: 5770895893828047079}
|
||||||
|
- component: {fileID: 6171680323948707521}
|
||||||
|
- component: {fileID: 6171680323948707549}
|
||||||
|
- component: {fileID: 6171680323948707520}
|
||||||
|
- component: {fileID: 8774702625908438859}
|
||||||
|
- component: {fileID: 6521536090983603910}
|
||||||
|
- component: {fileID: 6133354754598649724}
|
||||||
|
- component: {fileID: 2756943273076691504}
|
||||||
|
- component: {fileID: 6638271233700792696}
|
||||||
|
- component: {fileID: 5988018701276467001}
|
||||||
|
- component: {fileID: 1547882613481475944}
|
||||||
|
m_Layer: 8
|
||||||
|
m_Name: Bot
|
||||||
|
m_TagString: Defender
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &6171680323948707550
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 6171680323948707524}
|
||||||
|
m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068}
|
||||||
|
m_LocalPosition: {x: 50.67923, y: 1.16, z: -22.57}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 6171680323407988094}
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 0
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
|
||||||
|
--- !u!33 &6171680323948707551
|
||||||
MeshFilter:
|
MeshFilter:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2988578997639256874}
|
m_GameObject: {fileID: 6171680323948707524}
|
||||||
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
|
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
--- !u!23 &2988578997639256868
|
--- !u!23 &5770895893828047079
|
||||||
MeshRenderer:
|
MeshRenderer:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2988578997639256874}
|
m_GameObject: {fileID: 6171680323948707524}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_CastShadows: 1
|
m_CastShadows: 1
|
||||||
m_ReceiveShadows: 1
|
m_ReceiveShadows: 1
|
||||||
@ -86,90 +120,58 @@ MeshRenderer:
|
|||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
--- !u!136 &2988578997639256875
|
--- !u!136 &6171680323948707521
|
||||||
CapsuleCollider:
|
CapsuleCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2988578997639256874}
|
m_GameObject: {fileID: 6171680323948707524}
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 0}
|
||||||
m_IsTrigger: 0
|
m_IsTrigger: 0
|
||||||
m_Enabled: 1
|
m_Enabled: 0
|
||||||
m_Radius: 0.5
|
m_Radius: 0.3
|
||||||
m_Height: 2
|
m_Height: 2
|
||||||
m_Direction: 1
|
m_Direction: 1
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
--- !u!114 &5447337162552783061
|
--- !u!136 &6171680323948707549
|
||||||
MonoBehaviour:
|
CapsuleCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2988578997639256874}
|
m_GameObject: {fileID: 6171680323948707524}
|
||||||
m_Enabled: 1
|
m_Material: {fileID: 0}
|
||||||
m_EditorHideFlags: 0
|
m_IsTrigger: 0
|
||||||
m_Script: {fileID: 11500000, guid: a6f2a081cfc8c4b4bb6864331109d147, type: 3}
|
m_Enabled: 0
|
||||||
m_Name:
|
m_Radius: 0.3
|
||||||
m_EditorClassIdentifier:
|
m_Height: 1.3
|
||||||
agentParameters:
|
m_Direction: 1
|
||||||
maxStep: 0
|
m_Center: {x: 0, y: -0.35, z: 0}
|
||||||
hasUpgradedFromAgentParameters: 1
|
--- !u!136 &6171680323948707520
|
||||||
MaxStep: 100
|
CapsuleCollider:
|
||||||
--- !u!114 &7805954453358028498
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2988578997639256874}
|
m_GameObject: {fileID: 6171680323948707524}
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IsTrigger: 0
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_Radius: 0.3
|
||||||
m_Script: {fileID: 11500000, guid: 3a5c9d521e5ef4759a8246a07d52221e, type: 3}
|
m_Height: 0.8
|
||||||
m_Name:
|
m_Direction: 1
|
||||||
m_EditorClassIdentifier:
|
m_Center: {x: 0, y: -0.6, z: 0}
|
||||||
DecisionPeriod: 1
|
--- !u!195 &8774702625908438859
|
||||||
TakeActionsBetweenDecisions: 1
|
|
||||||
--- !u!114 &2676446634235362783
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 2988578997639256874}
|
|
||||||
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: 0200000002000000
|
|
||||||
VectorActionSize: 0200000002000000
|
|
||||||
VectorActionDescriptions: []
|
|
||||||
VectorActionSpaceType: 0
|
|
||||||
hasUpgradedBrainParametersWithActionSpec: 1
|
|
||||||
m_Model: {fileID: 0}
|
|
||||||
m_InferenceDevice: 0
|
|
||||||
m_BehaviorType: 0
|
|
||||||
m_BehaviorName: npc
|
|
||||||
TeamId: 0
|
|
||||||
m_UseChildSensors: 1
|
|
||||||
m_UseChildActuators: 1
|
|
||||||
m_ObservableAttributeHandling: 0
|
|
||||||
--- !u!195 &8656710265340117963
|
|
||||||
NavMeshAgent:
|
NavMeshAgent:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2988578997639256874}
|
m_GameObject: {fileID: 6171680323948707524}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_AgentTypeID: 0
|
m_AgentTypeID: 0
|
||||||
m_Radius: 0.5
|
m_Radius: 0.5000001
|
||||||
m_Speed: 3.5
|
m_Speed: 3.5
|
||||||
m_Acceleration: 8
|
m_Acceleration: 8
|
||||||
avoidancePriority: 50
|
avoidancePriority: 50
|
||||||
@ -182,26 +184,27 @@ NavMeshAgent:
|
|||||||
m_BaseOffset: 1
|
m_BaseOffset: 1
|
||||||
m_WalkableMask: 4294967295
|
m_WalkableMask: 4294967295
|
||||||
m_ObstacleAvoidanceType: 4
|
m_ObstacleAvoidanceType: 4
|
||||||
--- !u!114 &778652956973742106
|
--- !u!114 &6521536090983603910
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2988578997639256874}
|
m_GameObject: {fileID: 6171680323948707524}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: d3ebcf807a37f344998fd648dfc9376d, type: 3}
|
m_Script: {fileID: 11500000, guid: d3ebcf807a37f344998fd648dfc9376d, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
navMeshAgent: {fileID: 8656710265340117963}
|
navMeshAgent: {fileID: 8774702625908438859}
|
||||||
--- !u!114 &1208561866453126566
|
flag: {fileID: 6818223691859422291, guid: 1685c1d9ce4ab174f95c646b1826010b, type: 3}
|
||||||
|
--- !u!114 &6133354754598649724
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2988578997639256874}
|
m_GameObject: {fileID: 6171680323948707524}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: dd8012d5925524537b27131fef517017, type: 3}
|
m_Script: {fileID: 11500000, guid: dd8012d5925524537b27131fef517017, type: 3}
|
||||||
@ -209,4 +212,78 @@ MonoBehaviour:
|
|||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_SensorName: BufferSensor
|
m_SensorName: BufferSensor
|
||||||
m_ObservableSize: 5
|
m_ObservableSize: 5
|
||||||
m_MaxNumObservables: 5
|
m_MaxNumObservables: 10
|
||||||
|
--- !u!114 &2756943273076691504
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 6171680323948707524}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 5d1c4e0b1822b495aa52bc52839ecb30, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_BrainParameters:
|
||||||
|
VectorObservationSize: 14
|
||||||
|
NumStackedVectorObservations: 1
|
||||||
|
m_ActionSpec:
|
||||||
|
m_NumContinuousActions: 0
|
||||||
|
BranchSizes: 010000000100000001000000
|
||||||
|
VectorActionSize: 010000000100000001000000
|
||||||
|
VectorActionDescriptions: []
|
||||||
|
VectorActionSpaceType: 0
|
||||||
|
hasUpgradedBrainParametersWithActionSpec: 1
|
||||||
|
m_Model: {fileID: 0}
|
||||||
|
m_InferenceDevice: 0
|
||||||
|
m_BehaviorType: 0
|
||||||
|
m_BehaviorName: npc
|
||||||
|
TeamId: 0
|
||||||
|
m_UseChildSensors: 1
|
||||||
|
m_UseChildActuators: 1
|
||||||
|
m_ObservableAttributeHandling: 0
|
||||||
|
--- !u!114 &6638271233700792696
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 6171680323948707524}
|
||||||
|
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
|
||||||
|
--- !u!114 &5988018701276467001
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 6171680323948707524}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: d3ebcf807a37f344998fd648dfc9376d, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
navMeshAgent: {fileID: 8774702625908438859}
|
||||||
|
flag: {fileID: 6818223691859422291, guid: 1685c1d9ce4ab174f95c646b1826010b, type: 3}
|
||||||
|
--- !u!114 &1547882613481475944
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 6171680323948707524}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 3a5c9d521e5ef4759a8246a07d52221e, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
DecisionPeriod: 5
|
||||||
|
TakeActionsBetweenDecisions: 0
|
||||||
|
150
Assets/Prefabs/Player.prefab
generated
150
Assets/Prefabs/Player.prefab
generated
@ -14,9 +14,12 @@ GameObject:
|
|||||||
- component: {fileID: 5245491127989480120}
|
- component: {fileID: 5245491127989480120}
|
||||||
- component: {fileID: 5245491127989480100}
|
- component: {fileID: 5245491127989480100}
|
||||||
- component: {fileID: 5245491127989480121}
|
- component: {fileID: 5245491127989480121}
|
||||||
- component: {fileID: 5245491127989480123}
|
- component: {fileID: 7254047075221496626}
|
||||||
- component: {fileID: 5245491127989480122}
|
- component: {fileID: 5182704636738128575}
|
||||||
- component: {fileID: 4890899368932544690}
|
- component: {fileID: 5220658550450318085}
|
||||||
|
- component: {fileID: 4264677542023120457}
|
||||||
|
- component: {fileID: 4715950961444674817}
|
||||||
|
- component: {fileID: 5653209015090846528}
|
||||||
m_Layer: 8
|
m_Layer: 8
|
||||||
m_Name: Player
|
m_Name: Player
|
||||||
m_TagString: Defender
|
m_TagString: Defender
|
||||||
@ -129,25 +132,29 @@ CapsuleCollider:
|
|||||||
m_Height: 0.8
|
m_Height: 0.8
|
||||||
m_Direction: 1
|
m_Direction: 1
|
||||||
m_Center: {x: 0, y: -0.6, z: 0}
|
m_Center: {x: 0, y: -0.6, z: 0}
|
||||||
--- !u!143 &5245491127989480123
|
--- !u!195 &7254047075221496626
|
||||||
CharacterController:
|
NavMeshAgent:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 5245491127989480125}
|
m_GameObject: {fileID: 5245491127989480125}
|
||||||
m_Material: {fileID: 0}
|
|
||||||
m_IsTrigger: 0
|
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 2
|
m_AgentTypeID: 0
|
||||||
|
m_Radius: 0.5000001
|
||||||
|
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_Height: 2
|
||||||
m_Radius: 0.5
|
m_BaseOffset: 1
|
||||||
m_SlopeLimit: 45
|
m_WalkableMask: 4294967295
|
||||||
m_StepOffset: 0.3
|
m_ObstacleAvoidanceType: 4
|
||||||
m_SkinWidth: 0.08
|
--- !u!114 &5182704636738128575
|
||||||
m_MinMoveDistance: 0.001
|
|
||||||
m_Center: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!114 &5245491127989480122
|
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -156,52 +163,12 @@ MonoBehaviour:
|
|||||||
m_GameObject: {fileID: 5245491127989480125}
|
m_GameObject: {fileID: 5245491127989480125}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 9826297ef4d853741b2af768441ec7f7, type: 3}
|
m_Script: {fileID: 11500000, guid: d3ebcf807a37f344998fd648dfc9376d, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
input_View: {x: 0, y: 0}
|
navMeshAgent: {fileID: 0}
|
||||||
cameraHolder: {fileID: 5245491129196666053}
|
flag: {fileID: 0}
|
||||||
feetTransform: {fileID: 5245491129603592455}
|
--- !u!114 &5220658550450318085
|
||||||
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: 5245491127989480120}
|
|
||||||
playerCrouchStance:
|
|
||||||
CameraHeight: 0.3
|
|
||||||
StanceCollider: {fileID: 5245491127989480100}
|
|
||||||
playerProneStance:
|
|
||||||
CameraHeight: -0.58
|
|
||||||
StanceCollider: {fileID: 5245491127989480121}
|
|
||||||
currentWeapon: {fileID: 8510909888689775086}
|
|
||||||
--- !u!114 &4890899368932544690
|
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
@ -210,9 +177,72 @@ MonoBehaviour:
|
|||||||
m_GameObject: {fileID: 5245491127989480125}
|
m_GameObject: {fileID: 5245491127989480125}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: a8c9a8e604d395c4ab9d03d28adc4982, type: 3}
|
m_Script: {fileID: 11500000, guid: dd8012d5925524537b27131fef517017, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
m_SensorName: BufferSensor
|
||||||
|
m_ObservableSize: 0
|
||||||
|
m_MaxNumObservables: 0
|
||||||
|
--- !u!114 &4264677542023120457
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5245491127989480125}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 5d1c4e0b1822b495aa52bc52839ecb30, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_BrainParameters:
|
||||||
|
VectorObservationSize: 1
|
||||||
|
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: 0
|
||||||
|
m_BehaviorName: My Behavior
|
||||||
|
TeamId: 0
|
||||||
|
m_UseChildSensors: 1
|
||||||
|
m_UseChildActuators: 1
|
||||||
|
m_ObservableAttributeHandling: 0
|
||||||
|
--- !u!114 &4715950961444674817
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5245491127989480125}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: a6f2a081cfc8c4b4bb6864331109d147, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
agentParameters:
|
||||||
|
maxStep: 0
|
||||||
|
hasUpgradedFromAgentParameters: 1
|
||||||
|
MaxStep: 0
|
||||||
|
--- !u!114 &5653209015090846528
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 5245491127989480125}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: d3ebcf807a37f344998fd648dfc9376d, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
navMeshAgent: {fileID: 7254047075221496626}
|
||||||
|
flag: {fileID: 0}
|
||||||
--- !u!1 &5245491128202443531
|
--- !u!1 &5245491128202443531
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
2
Assets/Prefabs/Player.prefab.meta
generated
Executable file → Normal file
2
Assets/Prefabs/Player.prefab.meta
generated
Executable file → Normal file
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 99bb17a23a489624baeaf337f91a4f84
|
guid: a7480b77908b042d8adcdd84e8c2c15e
|
||||||
PrefabImporter:
|
PrefabImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
213
Assets/Scenes/Greatest_map_ever/Greatest_map_ever.unity
generated
213
Assets/Scenes/Greatest_map_ever/Greatest_map_ever.unity
generated
@ -38,7 +38,7 @@ RenderSettings:
|
|||||||
m_ReflectionIntensity: 1
|
m_ReflectionIntensity: 1
|
||||||
m_CustomReflection: {fileID: 0}
|
m_CustomReflection: {fileID: 0}
|
||||||
m_Sun: {fileID: 705507994}
|
m_Sun: {fileID: 705507994}
|
||||||
m_IndirectSpecularColor: {r: 0.44657815, g: 0.49641192, b: 0.57481617, a: 1}
|
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
|
||||||
m_UseRadianceAmbientProbe: 0
|
m_UseRadianceAmbientProbe: 0
|
||||||
--- !u!157 &3
|
--- !u!157 &3
|
||||||
LightmapSettings:
|
LightmapSettings:
|
||||||
@ -259,6 +259,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 6a2d29bfc31a8cf4e831e3bb80720414, type: 3}
|
m_Script: {fileID: 11500000, guid: 6a2d29bfc31a8cf4e831e3bb80720414, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
navType: 1
|
||||||
PointId: 0
|
PointId: 0
|
||||||
DeathAttr: 0
|
DeathAttr: 0
|
||||||
EnemiesSeen: []
|
EnemiesSeen: []
|
||||||
@ -354,6 +355,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 6a2d29bfc31a8cf4e831e3bb80720414, type: 3}
|
m_Script: {fileID: 11500000, guid: 6a2d29bfc31a8cf4e831e3bb80720414, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
navType: 1
|
||||||
PointId: 0
|
PointId: 0
|
||||||
DeathAttr: 0
|
DeathAttr: 0
|
||||||
EnemiesSeen: []
|
EnemiesSeen: []
|
||||||
@ -1122,7 +1124,7 @@ Transform:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 705507993}
|
m_GameObject: {fileID: 705507993}
|
||||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||||
m_LocalPosition: {x: 81.2, y: 64.1, z: -12.4}
|
m_LocalPosition: {x: 77.5, y: 55.2, z: -5.9}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
@ -1253,12 +1255,6 @@ Transform:
|
|||||||
m_Father: {fileID: 671439045}
|
m_Father: {fileID: 671439045}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 1
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
|
||||||
--- !u!4 &868386701 stripped
|
|
||||||
Transform:
|
|
||||||
m_CorrespondingSourceObject: {fileID: 4528203470625763689, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
m_PrefabInstance: {fileID: 1809549197}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
--- !u!1 &884498019
|
--- !u!1 &884498019
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -1292,80 +1288,6 @@ Transform:
|
|||||||
m_Father: {fileID: 782729761}
|
m_Father: {fileID: 782729761}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!1001 &1061293905
|
|
||||||
PrefabInstance:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Modification:
|
|
||||||
m_TransformParent: {fileID: 868386701}
|
|
||||||
m_Modifications:
|
|
||||||
- target: {fileID: 2836004473841745626, guid: f432554f564e69242897607d34218939,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_Controller
|
|
||||||
value:
|
|
||||||
objectReference: {fileID: 9100000, guid: 95a44e56d04c7d248ba723eda9611c51, type: 2}
|
|
||||||
- target: {fileID: 2836004475591197023, guid: f432554f564e69242897607d34218939,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_RootOrder
|
|
||||||
value: 2
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 2836004475591197023, guid: f432554f564e69242897607d34218939,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalPosition.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 2836004475591197023, guid: f432554f564e69242897607d34218939,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalPosition.y
|
|
||||||
value: -1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 2836004475591197023, guid: f432554f564e69242897607d34218939,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalPosition.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 2836004475591197023, guid: f432554f564e69242897607d34218939,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalRotation.w
|
|
||||||
value: 1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 2836004475591197023, guid: f432554f564e69242897607d34218939,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalRotation.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 2836004475591197023, guid: f432554f564e69242897607d34218939,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalRotation.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 2836004475591197023, guid: f432554f564e69242897607d34218939,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalRotation.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 2836004475591197023, guid: f432554f564e69242897607d34218939,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 2836004475591197023, guid: f432554f564e69242897607d34218939,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 2836004475591197023, guid: f432554f564e69242897607d34218939,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 2836004475591695743, guid: f432554f564e69242897607d34218939,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_Name
|
|
||||||
value: DragonFucker
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
m_RemovedComponents: []
|
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: f432554f564e69242897607d34218939, type: 3}
|
|
||||||
--- !u!1 &1116745543
|
--- !u!1 &1116745543
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -1397,6 +1319,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 6a2d29bfc31a8cf4e831e3bb80720414, type: 3}
|
m_Script: {fileID: 11500000, guid: 6a2d29bfc31a8cf4e831e3bb80720414, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
navType: 1
|
||||||
PointId: 0
|
PointId: 0
|
||||||
DeathAttr: 0
|
DeathAttr: 0
|
||||||
EnemiesSeen: []
|
EnemiesSeen: []
|
||||||
@ -1560,7 +1483,7 @@ Mesh:
|
|||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_Name: pb_Mesh17416
|
m_Name: pb_Mesh16900
|
||||||
serializedVersion: 10
|
serializedVersion: 10
|
||||||
m_SubMeshes:
|
m_SubMeshes:
|
||||||
- serializedVersion: 2
|
- serializedVersion: 2
|
||||||
@ -1828,7 +1751,7 @@ Transform:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1345085340}
|
m_GameObject: {fileID: 1345085340}
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 21.51, y: -5.782543, z: -10.46}
|
m_LocalPosition: {x: 47.446796, y: -5.782543, z: -25.400002}
|
||||||
m_LocalScale: {x: 1.4367, y: 1.4367, z: 1.4367}
|
m_LocalScale: {x: 1.4367, y: 1.4367, z: 1.4367}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 2060099472}
|
m_Father: {fileID: 2060099472}
|
||||||
@ -1846,6 +1769,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 6a2d29bfc31a8cf4e831e3bb80720414, type: 3}
|
m_Script: {fileID: 11500000, guid: 6a2d29bfc31a8cf4e831e3bb80720414, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
navType: 1
|
||||||
PointId: 0
|
PointId: 0
|
||||||
DeathAttr: 0
|
DeathAttr: 0
|
||||||
EnemiesSeen: []
|
EnemiesSeen: []
|
||||||
@ -1941,6 +1865,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 6a2d29bfc31a8cf4e831e3bb80720414, type: 3}
|
m_Script: {fileID: 11500000, guid: 6a2d29bfc31a8cf4e831e3bb80720414, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
navType: 1
|
||||||
PointId: 0
|
PointId: 0
|
||||||
DeathAttr: 0
|
DeathAttr: 0
|
||||||
EnemiesSeen: []
|
EnemiesSeen: []
|
||||||
@ -2162,6 +2087,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 6a2d29bfc31a8cf4e831e3bb80720414, type: 3}
|
m_Script: {fileID: 11500000, guid: 6a2d29bfc31a8cf4e831e3bb80720414, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
navType: 1
|
||||||
PointId: 0
|
PointId: 0
|
||||||
DeathAttr: 0
|
DeathAttr: 0
|
||||||
EnemiesSeen: []
|
EnemiesSeen: []
|
||||||
@ -2212,105 +2138,6 @@ MeshFilter:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1663305221}
|
m_GameObject: {fileID: 1663305221}
|
||||||
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
|
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
--- !u!1001 &1809549197
|
|
||||||
PrefabInstance:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Modification:
|
|
||||||
m_TransformParent: {fileID: 0}
|
|
||||||
m_Modifications:
|
|
||||||
- target: {fileID: -4942972567661207728, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_Enabled
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763689, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_RootOrder
|
|
||||||
value: 6
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763689, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalPosition.x
|
|
||||||
value: 42.23
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763689, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalPosition.y
|
|
||||||
value: 1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763689, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalPosition.z
|
|
||||||
value: -15.91
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763689, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalRotation.w
|
|
||||||
value: 1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763689, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalRotation.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763689, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalRotation.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763689, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalRotation.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763689, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763689, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763689, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalEulerAnglesHint.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763699, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_Name
|
|
||||||
value: Player
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763700, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: playerStance
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763700, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: playerCrouchStance.CameraHeight
|
|
||||||
value: 0.3
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203470625763703, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_Enabled
|
|
||||||
value: 1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203471293941515, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalPosition.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 4528203471293941515, guid: 99bb17a23a489624baeaf337f91a4f84,
|
|
||||||
type: 3}
|
|
||||||
propertyPath: m_LocalPosition.z
|
|
||||||
value: -2.417
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
m_RemovedComponents: []
|
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 99bb17a23a489624baeaf337f91a4f84, type: 3}
|
|
||||||
--- !u!1 &1858987083
|
--- !u!1 &1858987083
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -2326,6 +2153,7 @@ GameObject:
|
|||||||
- component: {fileID: 1858987090}
|
- component: {fileID: 1858987090}
|
||||||
- component: {fileID: 1858987088}
|
- component: {fileID: 1858987088}
|
||||||
- component: {fileID: 1858987085}
|
- component: {fileID: 1858987085}
|
||||||
|
- component: {fileID: 1858987091}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Game
|
m_Name: Game
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -2434,10 +2262,22 @@ MonoBehaviour:
|
|||||||
- {fileID: 140697606}
|
- {fileID: 140697606}
|
||||||
spawnPointsForAttackersTeam:
|
spawnPointsForAttackersTeam:
|
||||||
- {fileID: 2004854094}
|
- {fileID: 2004854094}
|
||||||
AIPrefab: {fileID: 2988578997639256874, guid: b016874eb34cc084aa4359f0bbec50e1,
|
AIPrefab: {fileID: 6171680323948707524, guid: b016874eb34cc084aa4359f0bbec50e1,
|
||||||
type: 3}
|
type: 3}
|
||||||
PlayerPrefab: {fileID: 5245491127989480125, guid: 99bb17a23a489624baeaf337f91a4f84,
|
PlayerPrefab: {fileID: 5245491127989480125, guid: 80f6c1c85e5daed4c96c70205ed5503d,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
--- !u!114 &1858987091
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1858987083}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: bf3fe86787bfb0c4b8751fe495148ede, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &1871257865
|
--- !u!1 &1871257865
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -2691,6 +2531,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 6a2d29bfc31a8cf4e831e3bb80720414, type: 3}
|
m_Script: {fileID: 11500000, guid: 6a2d29bfc31a8cf4e831e3bb80720414, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
navType: 1
|
||||||
PointId: 0
|
PointId: 0
|
||||||
DeathAttr: 0
|
DeathAttr: 0
|
||||||
EnemiesSeen: []
|
EnemiesSeen: []
|
||||||
@ -2779,7 +2620,7 @@ Transform:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2060099471}
|
m_GameObject: {fileID: 2060099471}
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 27.79, y: 7.782543, z: -15}
|
m_LocalPosition: {x: 19.553204, y: 7.782543, z: -15}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 1345085341}
|
- {fileID: 1345085341}
|
||||||
|
@ -1,34 +1,36 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Unity;
|
|
||||||
|
|
||||||
public class CharacterFactory : MonoBehaviour
|
public class CharacterFactory : MonoBehaviour
|
||||||
{
|
{
|
||||||
private CharacterFactory instance;
|
private static CharacterFactory instance;
|
||||||
public CharacterFactory Instance { get { return instance; } }
|
public static CharacterFactory Instance => instance;
|
||||||
|
|
||||||
[SerializeField] private List<NavPoint> spawnPointsForDefendersTeam;
|
[SerializeField] private List<NavPoint> spawnPointsForDefendersTeam;
|
||||||
[SerializeField] private List<NavPoint> spawnPointsForAttackersTeam;
|
[SerializeField] private List<NavPoint> spawnPointsForAttackersTeam;
|
||||||
[SerializeField] private GameObject AIPrefab;
|
[SerializeField] private GameObject AIPrefab;
|
||||||
[SerializeField] private GameObject PlayerPrefab;
|
[SerializeField] private GameObject PlayerPrefab;
|
||||||
|
|
||||||
private List<GameObject> Bots = new List<GameObject>();
|
private List<GameObject> bots = new List<GameObject>();
|
||||||
private GameObject Player;
|
public GameObject player { get; private set; }
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
if (instance == null)
|
if (instance == null)
|
||||||
instance = this;
|
instance = this;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
|
Debug.LogError("Only 1 Instance");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
var attcNum = SettingsReader.Instance.GetSettings.numOfAttackers;
|
var attcNum = SettingsReader.Instance.GetSettings.NumOfAttackers;
|
||||||
var defNum = SettingsReader.Instance.GetSettings.numOfDefenders;
|
var defNum = SettingsReader.Instance.GetSettings.NumOfDefenders;
|
||||||
var humanDef = SettingsReader.Instance.GetSettings.hasHumanDefender == true ? 1 : 0;
|
var humanDef = SettingsReader.Instance.GetSettings.HasHumanDefender == true ? 1 : 0;
|
||||||
var humanAtc = SettingsReader.Instance.GetSettings.hasHumanAttacker == true ? 1 : 0;
|
var humanAtc = SettingsReader.Instance.GetSettings.HasHumanAttacker == true ? 1 : 0;
|
||||||
|
|
||||||
if (humanAtc == 1 && humanDef == 1)
|
if (humanAtc == 1 && humanDef == 1)
|
||||||
throw new System.ArgumentException("Can be only one human player");
|
throw new System.ArgumentException("Can be only one human player");
|
||||||
@ -53,42 +55,60 @@ public class CharacterFactory : MonoBehaviour
|
|||||||
{
|
{
|
||||||
var gameobject = GameObject.Instantiate(
|
var gameobject = GameObject.Instantiate(
|
||||||
typeAi == TypeAI.HumanAI ? PlayerPrefab : AIPrefab,
|
typeAi == TypeAI.HumanAI ? PlayerPrefab : AIPrefab,
|
||||||
spawnPoint.position,
|
spawnPoint.Position,
|
||||||
Quaternion.identity);
|
Quaternion.identity);
|
||||||
gameobject.SetActive(true);
|
gameobject.SetActive(true);
|
||||||
|
if (team == Team.Attackers)
|
||||||
|
gameObject.tag = "Attacker";
|
||||||
|
else
|
||||||
|
gameObject.tag = "Defender";
|
||||||
|
|
||||||
if (typeAi == TypeAI.HumanAI)
|
if (typeAi == TypeAI.HumanAI)
|
||||||
{
|
{
|
||||||
gameobject.GetComponent<Player>().GetCharacter.Team = team;
|
gameobject.GetComponent<Player>().GetCharacter.Team = team;
|
||||||
Player = gameobject;
|
player = gameobject;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gameobject.GetComponent<NPC>().GetCharacter.Team = team;
|
gameobject.GetComponent<NPC>().GetCharacter.Team = team;
|
||||||
gameobject.GetComponent<MovementController>().currentPosition = spawnPoint;
|
gameobject.GetComponent<MovementController>().PointStartID = spawnPoint.PointId;
|
||||||
Bots.Add(gameobject);
|
bots.Add(gameobject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ReSpawn(ICharacter character, ref Vector3 pos, ref int startPointId)
|
||||||
|
{
|
||||||
|
character.ResetCharacter();
|
||||||
|
var team = character.GetCharacter.Team;
|
||||||
|
NavPoint navPoint;
|
||||||
|
if (team == Team.Attackers)
|
||||||
|
navPoint = spawnPointsForAttackersTeam[Random.Range(0, spawnPointsForAttackersTeam.Count)];
|
||||||
|
else
|
||||||
|
navPoint = spawnPointsForDefendersTeam[Random.Range(0, spawnPointsForDefendersTeam.Count)];
|
||||||
|
|
||||||
|
pos = navPoint.Position;
|
||||||
|
startPointId = navPoint.PointId;
|
||||||
|
}
|
||||||
|
|
||||||
private void ResetCharacters()
|
private void ResetCharacters()
|
||||||
{
|
{
|
||||||
foreach (var bot in Bots)
|
foreach (var bot in bots)
|
||||||
{
|
{
|
||||||
var npc = bot.GetComponent<NPC>();
|
var npc = bot.GetComponent<NPC>();
|
||||||
npc.ResetCharacter();
|
npc.ResetCharacter();
|
||||||
if (npc.GetCharacter.Team == Team.Attackers)
|
if (npc.GetCharacter.Team == Team.Attackers)
|
||||||
bot.transform.position = spawnPointsForAttackersTeam[Random.Range(0, spawnPointsForAttackersTeam.Count)].position;
|
bot.transform.position = spawnPointsForAttackersTeam[Random.Range(0, spawnPointsForAttackersTeam.Count)].Position;
|
||||||
else
|
else
|
||||||
bot.transform.position = spawnPointsForDefendersTeam[Random.Range(0, spawnPointsForDefendersTeam.Count)].position;
|
bot.transform.position = spawnPointsForDefendersTeam[Random.Range(0, spawnPointsForDefendersTeam.Count)].Position;
|
||||||
}
|
}
|
||||||
var player = Player.GetComponent<Player>();
|
Player player;
|
||||||
if (player != null)
|
if (TryGetComponent<Player>(out player))
|
||||||
{
|
{
|
||||||
player.ResetCharacter();
|
player.ResetCharacter();
|
||||||
if (player.GetCharacter.Team == Team.Attackers)
|
if (player.GetCharacter.Team == Team.Attackers)
|
||||||
Player.transform.position = spawnPointsForAttackersTeam[Random.Range(0, spawnPointsForAttackersTeam.Count)].position;
|
this.player.transform.position = spawnPointsForAttackersTeam[Random.Range(0, spawnPointsForAttackersTeam.Count)].Position;
|
||||||
else
|
else
|
||||||
Player.transform.position = spawnPointsForDefendersTeam[Random.Range(0, spawnPointsForDefendersTeam.Count)].position;
|
this.player.transform.position = spawnPointsForDefendersTeam[Random.Range(0, spawnPointsForDefendersTeam.Count)].Position;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,3 +3,14 @@
|
|||||||
Defenders,
|
Defenders,
|
||||||
Attackers,
|
Attackers,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class TeamExtension
|
||||||
|
{
|
||||||
|
public static Team GetOppositeTeam(this Team team)
|
||||||
|
{
|
||||||
|
if (team == Team.Attackers)
|
||||||
|
return Team.Defenders;
|
||||||
|
else
|
||||||
|
return Team.Attackers;
|
||||||
|
}
|
||||||
|
}
|
@ -7,12 +7,6 @@ public class Character
|
|||||||
|
|
||||||
public Character()
|
public Character()
|
||||||
{
|
{
|
||||||
Debug.Log("init");
|
|
||||||
Condition = new CharacterCondition();
|
Condition = new CharacterCondition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ICharacter
|
|
||||||
{
|
|
||||||
Character GetCharacter { get; }
|
|
||||||
}
|
|
@ -9,7 +9,6 @@ public class CharacterCondition
|
|||||||
public event Action<int> OnChangeAmmunitionEvent;
|
public event Action<int> OnChangeAmmunitionEvent;
|
||||||
|
|
||||||
private int health;
|
private int health;
|
||||||
|
|
||||||
public int HealthPoints
|
public int HealthPoints
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -22,6 +21,17 @@ public class CharacterCondition
|
|||||||
OnChangeHealthEvent?.Invoke(value);
|
OnChangeHealthEvent?.Invoke(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int GetHealthPointsInQuantile()
|
||||||
|
{
|
||||||
|
if (health < 25)
|
||||||
|
return 0;
|
||||||
|
else if (health < 50)
|
||||||
|
return 1;
|
||||||
|
else if (health < 75)
|
||||||
|
return 2;
|
||||||
|
else return 3;
|
||||||
|
}
|
||||||
private int armour;
|
private int armour;
|
||||||
public int ArmourPoints
|
public int ArmourPoints
|
||||||
{
|
{
|
||||||
@ -35,6 +45,17 @@ public class CharacterCondition
|
|||||||
OnChangeArmourEvent?.Invoke(value);
|
OnChangeArmourEvent?.Invoke(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public int GetArmourPointsInQuantile()
|
||||||
|
{
|
||||||
|
if (armour < 25)
|
||||||
|
return 0;
|
||||||
|
else if (armour < 50)
|
||||||
|
return 1;
|
||||||
|
else if (armour < 75)
|
||||||
|
return 2;
|
||||||
|
else return 3;
|
||||||
|
}
|
||||||
|
|
||||||
private int ammo;
|
private int ammo;
|
||||||
public int Ammunition
|
public int Ammunition
|
||||||
{
|
{
|
||||||
@ -50,11 +71,16 @@ public class CharacterCondition
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CharacterCondition()
|
public CharacterCondition()
|
||||||
|
{
|
||||||
|
this.Reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Reset()
|
||||||
{
|
{
|
||||||
var settings = SettingsReader.Instance.GetSettings;
|
var settings = SettingsReader.Instance.GetSettings;
|
||||||
ammo = settings.maxAmmo;
|
ammo = settings.MaxAmmo;
|
||||||
health = settings.maxHealth;
|
health = settings.MaxHealth;
|
||||||
armour = settings.maxArmour;
|
armour = settings.MaxArmour;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GiveHealth(int health) => HealthPoints = Mathf.Clamp(health + HealthPoints, 0, 100);
|
public void GiveHealth(int health) => HealthPoints = Mathf.Clamp(health + HealthPoints, 0, 100);
|
||||||
|
2
Assets/Scripts/Sensors.meta → Assets/Scripts/Character/Interfaces.meta
generated
Executable file → Normal file
2
Assets/Scripts/Sensors.meta → Assets/Scripts/Character/Interfaces.meta
generated
Executable file → Normal file
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5e73ba257bc6b684c86edf9ecfd475ef
|
guid: f23b6db3be1e4cd469fd18dfe3e39764
|
||||||
folderAsset: yes
|
folderAsset: yes
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
5
Assets/Scripts/Character/Interfaces/ICharacter.cs
Normal file
5
Assets/Scripts/Character/Interfaces/ICharacter.cs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
public interface ICharacter
|
||||||
|
{
|
||||||
|
Character GetCharacter { get; }
|
||||||
|
void ResetCharacter();
|
||||||
|
}
|
2
Assets/Scripts/Sensors/SensorType.cs.meta → Assets/Scripts/Character/Interfaces/ICharacter.cs.meta
generated
Executable file → Normal file
2
Assets/Scripts/Sensors/SensorType.cs.meta → Assets/Scripts/Character/Interfaces/ICharacter.cs.meta
generated
Executable file → Normal file
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 8f76201fe6436164789d10350a0fd6e2
|
guid: b6dfb78244ae35c4db1326d5f5b73375
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
17
Assets/Scripts/Character/Interfaces/INpcBaseState.cs
Normal file
17
Assets/Scripts/Character/Interfaces/INpcBaseState.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public interface INpcBaseState
|
||||||
|
{
|
||||||
|
NpcEnumState State { get; }
|
||||||
|
bool InCover { get; }
|
||||||
|
bool IsRunning { get; }
|
||||||
|
bool InDirectPoint { get; }
|
||||||
|
float HitChance { get; }
|
||||||
|
float DoDamageChance { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface INpcBaseBodyState
|
||||||
|
{
|
||||||
|
NpcBodyState State { get; }
|
||||||
|
Vector3 GetPointToHit(GameObject go);
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 4599c57bc5b1c3945847dead0f9f0ba4
|
guid: 58b7e1962495ada4c8e6ee6219c99a20
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
@ -1,47 +1,83 @@
|
|||||||
using System.Linq;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.AI;
|
using UnityEngine.AI;
|
||||||
|
|
||||||
[RequireComponent(typeof(NavMeshAgent))]
|
[RequireComponent(typeof(NavMeshAgent))]
|
||||||
public class MovementController : MonoBehaviour
|
public class MovementController : MonoBehaviour
|
||||||
{
|
{
|
||||||
public NavPoint currentPosition { get; set; }
|
public int PointStartID { get; set; }
|
||||||
private Dictionary<int, NavPoint> navPoints = new Dictionary<int, NavPoint>();
|
public int PointEndID { get; private set; }
|
||||||
|
public float FlagDistance { get; private set; }
|
||||||
|
private const float UpdateFlagPositionDelay = 5;
|
||||||
|
private const float UpdateReachedDestinationDelay = 5;
|
||||||
|
|
||||||
[SerializeField] private NavMeshAgent navMeshAgent;
|
[SerializeField] private NavMeshAgent navMeshAgent;
|
||||||
|
[SerializeField] private GameObject flag;
|
||||||
|
public float DistanceToGo { get; private set; }
|
||||||
|
public float RemainingDistance => navMeshAgent.remainingDistance;
|
||||||
|
private Dictionary<int, NavPoint> _idNavPointDict;
|
||||||
|
|
||||||
private void Start()
|
|
||||||
|
private void Awake()
|
||||||
{
|
{
|
||||||
navMeshAgent.speed = SettingsReader.Instance.GetSettings.movementSpeed;
|
navMeshAgent.speed = SettingsReader.Instance.GetSettings.MovementSpeed;
|
||||||
foreach (var np in MapManager.navPoints) {
|
_idNavPointDict = MapManager.Instance.IDToNavPoint;
|
||||||
navPoints[np.PointId] = np;
|
InvokeRepeating(nameof(UpdateFlagPosition), 0, UpdateFlagPositionDelay);
|
||||||
}
|
InvokeRepeating(nameof(ReachedDestination), 0, UpdateReachedDestinationDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MoveToPointById(int id)
|
private void OnDestroy()
|
||||||
{
|
{
|
||||||
if (!navPoints.ContainsKey(id))
|
CancelInvoke(nameof(UpdateFlagPosition));
|
||||||
{
|
CancelInvoke(nameof(ReachedDestination));
|
||||||
Debug.LogWarning("PIDOR");
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
goToNextNavPoint(navPoints[id]);
|
|
||||||
|
private void UpdateFlagPosition()
|
||||||
|
{
|
||||||
|
FlagDistance = (flag.transform.position - gameObject.transform.position).magnitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MoveToRandomPoint()
|
public void MoveToRandomPoint()
|
||||||
{
|
{
|
||||||
// Debug.Log(MapManager.navPoints == null);
|
GoToNextNavPoint(MapManager.Instance.NavPoints[Random.Range(0, MapManager.Instance.NavPoints.Count)]);
|
||||||
goToNextNavPoint(MapManager.navPoints[Random.Range(0, MapManager.navPoints.Count)]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<NavPoint> getPointsCandidate()
|
public List<NavPoint> GetPointsCandidate()
|
||||||
{
|
{
|
||||||
return MapManager.navPoints
|
return MapManager.Instance.NavPoints
|
||||||
.Where(point => (currentPosition.position - point.position).magnitude < SettingsReader.Instance.GetSettings.movementDistance)
|
.Where(point =>
|
||||||
|
(_idNavPointDict[PointStartID].Position - point.Position).magnitude < SettingsReader.Instance.GetSettings.MovementDistance)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void goToNextNavPoint(NavPoint destination) =>
|
public void GoToNextNavPoint(NavPoint destination)
|
||||||
navMeshAgent.SetDestination(destination.position);
|
{
|
||||||
|
if (navMeshAgent.isStopped == true) navMeshAgent.isStopped = false;
|
||||||
|
PointStartID = PointEndID;
|
||||||
|
PointEndID = destination.PointId;
|
||||||
|
navMeshAgent.SetDestination(destination.Position);
|
||||||
|
DistanceToGo = navMeshAgent.remainingDistance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReturnToStartPoint()
|
||||||
|
{
|
||||||
|
if (navMeshAgent.isStopped == true) navMeshAgent.isStopped = false;
|
||||||
|
navMeshAgent.SetDestination(_idNavPointDict[PointStartID].Position);
|
||||||
|
PointEndID = PointStartID;
|
||||||
|
PointStartID = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StopOnPath()
|
||||||
|
{
|
||||||
|
navMeshAgent.isStopped = true;
|
||||||
|
PointStartID = -1;
|
||||||
|
PointEndID = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReachedDestination()
|
||||||
|
{
|
||||||
|
if ((navMeshAgent.isStopped == false) && (navMeshAgent.velocity.magnitude < 0.1))
|
||||||
|
PointStartID = PointEndID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,122 +1,212 @@
|
|||||||
using System;
|
using System;
|
||||||
using UnityEngine;
|
|
||||||
using Unity.MLAgents;
|
|
||||||
using Unity.MLAgents.Sensors;
|
|
||||||
using Unity.MLAgents.Actuators;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Unity.MLAgents;
|
||||||
|
using Unity.MLAgents.Actuators;
|
||||||
|
using Unity.MLAgents.Sensors;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
[RequireComponent(typeof(MovementController))]
|
[RequireComponent(typeof(MovementController),typeof(BufferSensorComponent))]
|
||||||
public class NPC : Agent, ICharacter
|
public class NPC : Agent, ICharacter
|
||||||
{
|
{
|
||||||
[HideInInspector]
|
[HideInInspector]
|
||||||
public Character AgentCharacter;
|
private Character AgentCharacter;
|
||||||
public CharacterCondition Condition;
|
public CharacterCondition Condition;
|
||||||
|
private FlagZone flagZone = null;
|
||||||
|
|
||||||
public NPC_BaseState NPC_State { get; private set; }
|
public INpcBaseState NpcState { get; private set; }
|
||||||
|
public INpcBaseBodyState NpcBodyState { get; private set; }
|
||||||
|
|
||||||
public Character GetCharacter => AgentCharacter;
|
public Character GetCharacter => AgentCharacter;
|
||||||
|
|
||||||
private NPC_DirectPointState DirectState;
|
private NpcDirectPointState DirectState;
|
||||||
private NPC_InCoverState CoverState;
|
private NpcInCoverState CoverState;
|
||||||
private NPC_RunningState RunningState;
|
private NpcRunningState RunningState;
|
||||||
|
|
||||||
|
private NpcStandingState StandingState;
|
||||||
|
private NpcCrouchingState CrouchingState;
|
||||||
|
|
||||||
private MovementController moveController;
|
private MovementController moveController;
|
||||||
private BufferSensorComponent bufferSensor;
|
private BufferSensorComponent bufferSensor;
|
||||||
|
|
||||||
|
private Dictionary<int, NavPoint> navPointIdDict;
|
||||||
|
|
||||||
|
#region UnityEvents and ML
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
DirectState = new NPC_DirectPointState();
|
DirectState = new NpcDirectPointState();
|
||||||
CoverState = new NPC_InCoverState();
|
CoverState = new NpcInCoverState();
|
||||||
RunningState = new NPC_RunningState();
|
RunningState = new NpcRunningState();
|
||||||
NPC_State = DirectState;
|
NpcState = DirectState;
|
||||||
|
|
||||||
|
CrouchingState = new NpcCrouchingState();
|
||||||
|
StandingState = new NpcStandingState();
|
||||||
|
NpcBodyState = StandingState;
|
||||||
|
|
||||||
AgentCharacter = new Character();
|
AgentCharacter = new Character();
|
||||||
Condition = AgentCharacter.Condition;
|
Condition = AgentCharacter.Condition;
|
||||||
|
|
||||||
moveController = gameObject.GetComponent<MovementController>();
|
moveController = gameObject.GetComponent<MovementController>();
|
||||||
bufferSensor = gameObject.GetComponent<BufferSensorComponent>();
|
bufferSensor = gameObject.GetComponent<BufferSensorComponent>();
|
||||||
}
|
|
||||||
|
|
||||||
|
flagZone = GameObject.FindObjectOfType<FlagZone>();
|
||||||
|
if (flagZone is null)
|
||||||
|
Debug.LogError("Flag Is Not Set");
|
||||||
|
|
||||||
public void ResetCharacter()
|
navPointIdDict = MapManager.Instance.IDToNavPoint;
|
||||||
{
|
if (navPointIdDict is null)
|
||||||
Condition = new CharacterCondition();
|
Debug.LogError("Cant Find Nav Point Dictionary");
|
||||||
EndEpisode();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnEpisodeBegin()
|
|
||||||
{
|
|
||||||
NPC_State = DirectState;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void CollectObservations(VectorSensor sensor)
|
|
||||||
{
|
|
||||||
sensor.AddObservation(Condition.HealthPoints);
|
|
||||||
sensor.AddObservation(Condition.ArmourPoints);
|
|
||||||
sensor.AddObservation(Condition.Ammunition);
|
|
||||||
sensor.AddObservation((int) NPC_State.State);
|
|
||||||
|
|
||||||
var candidates = moveController.getPointsCandidate();
|
|
||||||
foreach (var point in candidates)
|
|
||||||
{
|
|
||||||
var parray = new float[]
|
|
||||||
{
|
|
||||||
//1 position in navpointId
|
|
||||||
(float) moveController.currentPosition.PointId,
|
|
||||||
//2 distance to flag
|
|
||||||
moveController.currentPosition.FlagDistance,
|
|
||||||
//3 death count in point
|
|
||||||
moveController.currentPosition.DeathAttr,
|
|
||||||
//4 flagEnemyDistance
|
|
||||||
GameManager.IsCloserToFlagFromNextNavPoint(point, transform.position) == true ? 1 : 0,
|
|
||||||
//5 EnemyVsNavPointDistance
|
|
||||||
GameManager.IsCloserToEnemyThanToNextNavPoint(point, transform.position, AgentCharacter.Team) == true
|
|
||||||
? 1
|
|
||||||
: 0
|
|
||||||
};
|
|
||||||
// var _parray = string.Join(" ", parray);
|
|
||||||
// Debug.Log("OBS: " + _parray);
|
|
||||||
bufferSensor.AppendObservation(parray);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Heuristic(in ActionBuffers actionsOut)
|
|
||||||
{
|
|
||||||
var discreteActionsOut = actionsOut.DiscreteActions;
|
|
||||||
if (Input.GetKeyDown(KeyCode.W))
|
|
||||||
{
|
|
||||||
discreteActionsOut[0] = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnActionReceived(ActionBuffers actions)
|
|
||||||
{
|
|
||||||
if (actions.DiscreteActions[0] == 1)
|
|
||||||
{
|
|
||||||
moveController.MoveToRandomPoint();
|
|
||||||
NPC_State = RunningState;
|
|
||||||
} else if (actions.DiscreteActions[0] == 2)
|
|
||||||
{
|
|
||||||
moveController.MoveToPointById(actions.DiscreteActions[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public event Action<object> OnKilledEvent;
|
|
||||||
public void GetDamage(float damage)
|
|
||||||
{
|
|
||||||
AgentCharacter.LastTimeHit = TimeManager.Instance.CurrentTime;
|
|
||||||
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);
|
|
||||||
moveController.currentPosition.DeathAttr += 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDestroy()
|
private void OnDestroy()
|
||||||
{
|
{
|
||||||
Debug.LogWarning("Pooled object was destroyed");
|
Debug.LogWarning("Pooled object was destroyed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void OnEpisodeBegin()
|
||||||
|
{
|
||||||
|
if (navPointIdDict is null)
|
||||||
|
Debug.LogError("Cant Find Nav Point Dictionary");
|
||||||
|
|
||||||
|
NpcState = DirectState;
|
||||||
|
flagZone = GameObject.FindObjectOfType<FlagZone>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void CollectObservations(VectorSensor sensor)
|
||||||
|
{
|
||||||
|
// Debug.Log("Collect observations called!");
|
||||||
|
navPointIdDict = MapManager.Instance.IDToNavPoint;
|
||||||
|
if (navPointIdDict is null)
|
||||||
|
Debug.LogError("Cant Find Nav Point Dictionary");
|
||||||
|
var candidates = moveController.GetPointsCandidate();
|
||||||
|
|
||||||
|
//common sensors
|
||||||
|
sensor.AddObservation(GameManager.IsHaveSeenByEnemy(AgentCharacter.Team.GetOppositeTeam(),
|
||||||
|
NpcBodyState.GetPointToHit(gameObject)).ToInt());
|
||||||
|
sensor.AddObservation(AgentCharacter.LastTimeHit);
|
||||||
|
sensor.AddObservation((!flagZone.IsNotOccup).ToInt());
|
||||||
|
sensor.AddObservation(Condition.GetHealthPointsInQuantile());
|
||||||
|
sensor.AddObservation(Condition.GetArmourPointsInQuantile());
|
||||||
|
sensor.AddObservation(candidates.Count);
|
||||||
|
sensor.AddObservation(moveController.PointStartID);
|
||||||
|
sensor.AddObservation(moveController.PointEndID);
|
||||||
|
// Debug.Log("Done common!");
|
||||||
|
//state sensors
|
||||||
|
sensor.AddObservation((int)NpcState.State);
|
||||||
|
sensor.AddObservation((int)NpcBodyState.State);
|
||||||
|
sensor.AddObservation(GameManager.IsEnemyNearby(gameObject.transform.position, AgentCharacter.Team));
|
||||||
|
sensor.AddObservation(navPointIdDict[moveController.PointStartID].DeathAttr);
|
||||||
|
sensor.AddObservation(navPointIdDict[moveController.PointEndID].DeathAttr);
|
||||||
|
sensor.AddObservation(moveController.FlagDistance);
|
||||||
|
// Debug.Log("Done state sensors!");
|
||||||
|
|
||||||
|
//point sensors
|
||||||
|
foreach (var point in candidates)
|
||||||
|
{
|
||||||
|
var position = transform.position;
|
||||||
|
bufferSensor.AppendObservation(new float[] {
|
||||||
|
point.DeathAttr,
|
||||||
|
(int)point.navType,
|
||||||
|
//4 flagEnemyDistance
|
||||||
|
GameManager.IsCloserToFlagFromNextNavPoint(point, position).ToInt(),
|
||||||
|
//5 EnemyVsNavPointDistance
|
||||||
|
GameManager.IsCloserToEnemyThanToNextNavPoint(point, position, AgentCharacter.Team.GetOppositeTeam()).ToInt(),
|
||||||
|
//6 Have been seen by enemy in this point
|
||||||
|
GameManager.IsHaveSeenByEnemy(AgentCharacter.Team.GetOppositeTeam(),
|
||||||
|
point.Position).ToInt()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Debug.Log("Done collect observations!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnActionReceived(ActionBuffers actions)
|
||||||
|
{
|
||||||
|
// Debug.Log("Actions recieved!");
|
||||||
|
var result = actions.DiscreteActions;
|
||||||
|
// Debug.Log(result[0] + " " + result[1]);
|
||||||
|
if (result[0] == 0)
|
||||||
|
{
|
||||||
|
if (navPointIdDict[moveController.PointStartID].navType != NavPointType.Cover)
|
||||||
|
return;
|
||||||
|
NpcState = CoverState;
|
||||||
|
|
||||||
|
switch (result[1])
|
||||||
|
{
|
||||||
|
case 0: Peek(); break;
|
||||||
|
case 1: Cover(); break;
|
||||||
|
case 3: Peek(); moveController.GoToNextNavPoint(navPointIdDict[result[2]]); break;
|
||||||
|
case 4: NpcState = DirectState; break;
|
||||||
|
default: throw new ArgumentException("Undefined Action recieved");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Debug.Log(result[0] == 1);
|
||||||
|
if (result[0] == 1)
|
||||||
|
{
|
||||||
|
// Debug.Log("BEFORE SOme shitty if >:(");
|
||||||
|
if (navPointIdDict[moveController.PointStartID].navType != NavPointType.Direction)
|
||||||
|
{
|
||||||
|
// Debug.Log("SOme shitty if >:(");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Debug.Log("FUCK");
|
||||||
|
|
||||||
|
switch (result[1])
|
||||||
|
{
|
||||||
|
case 0: moveController.GoToNextNavPoint(navPointIdDict[result[2]]);
|
||||||
|
NpcState = RunningState; Debug.Log("Go to point " + result[2]);break;
|
||||||
|
case 1: NpcState = DirectState; break;
|
||||||
|
default: throw new ArgumentException("Undefined Action recieved");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result[0] == 2)
|
||||||
|
{
|
||||||
|
if (moveController.PointStartID == moveController.PointEndID && moveController.PointEndID != -1)
|
||||||
|
return;
|
||||||
|
switch (result[1])
|
||||||
|
{
|
||||||
|
case 0: moveController.StopOnPath(); NpcState = DirectState; break;
|
||||||
|
case 1: moveController.ReturnToStartPoint(); NpcState = RunningState; break;
|
||||||
|
default: throw new ArgumentException("Undefined Action recieved");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Debug.Log("Actions processed!");
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public event Action<NpcBodyState> OnChangePosition;
|
||||||
|
private void Peek()
|
||||||
|
{
|
||||||
|
OnChangePosition?.Invoke(global::NpcBodyState.Standing);
|
||||||
|
NpcBodyState = StandingState;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Cover()
|
||||||
|
{
|
||||||
|
OnChangePosition?.Invoke(global::NpcBodyState.Crouching);
|
||||||
|
NpcBodyState = CrouchingState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public event Action<int, Team> OnDamageRecieved;
|
||||||
|
public void GetDamage(int damage)
|
||||||
|
{
|
||||||
|
AgentCharacter.LastTimeHit = TimeManager.Instance.CurrentTime;
|
||||||
|
Condition.GiveHealth(-Mathf.RoundToInt(damage * (1 - Condition.ArmourPoints * 0.5f)));
|
||||||
|
Condition.GiveArmour(-Mathf.RoundToInt(Mathf.Sqrt(damage) * 5));
|
||||||
|
OnDamageRecieved?.Invoke(damage, AgentCharacter.Team);
|
||||||
|
|
||||||
|
if (Condition.HealthPoints < 0)
|
||||||
|
{
|
||||||
|
MapManager.AddDeathAttributeToPoints(moveController.PointStartID, moveController.PointEndID,
|
||||||
|
moveController.DistanceToGo, moveController.RemainingDistance);
|
||||||
|
var pos = gameObject.transform.position;
|
||||||
|
var id = moveController.PointStartID;
|
||||||
|
CharacterFactory.Instance.ReSpawn(this, ref pos, ref id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ResetCharacter()
|
||||||
|
{
|
||||||
|
Condition.Reset();
|
||||||
|
EndEpisode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
public enum NPC_EnumState
|
|
||||||
{
|
|
||||||
InCover,
|
|
||||||
InDirectPoint,
|
|
||||||
InRunning,
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface NPC_BaseState
|
|
||||||
{
|
|
||||||
NPC_EnumState State { get; }
|
|
||||||
bool InCover { get; }
|
|
||||||
bool IsRunning { get; }
|
|
||||||
bool InDirectPoint { get; }
|
|
||||||
float HitChance { get; }
|
|
||||||
float DoDamageChance { get; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class NPC_DirectPointState : NPC_BaseState
|
|
||||||
{
|
|
||||||
public bool InCover => false;
|
|
||||||
public bool IsRunning => false;
|
|
||||||
public bool InDirectPoint => false;
|
|
||||||
public float HitChance => SettingsReader.Instance.GetSettings.GetHitChanceInDirectPoint;
|
|
||||||
public float DoDamageChance => SettingsReader.Instance.GetSettings.DoDamageChanceInDirectPoint;
|
|
||||||
public NPC_EnumState State => NPC_EnumState.InDirectPoint;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class NPC_RunningState : NPC_BaseState
|
|
||||||
{
|
|
||||||
public bool InCover => false;
|
|
||||||
public bool IsRunning => true;
|
|
||||||
public bool InDirectPoint => false;
|
|
||||||
public float HitChance => SettingsReader.Instance.GetSettings.GetHitChanceInRunning;
|
|
||||||
public float DoDamageChance => SettingsReader.Instance.GetSettings.DoDamageChanceInRunning;
|
|
||||||
public NPC_EnumState State => NPC_EnumState.InRunning;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class NPC_InCoverState : NPC_BaseState
|
|
||||||
{
|
|
||||||
public bool InCover => true;
|
|
||||||
public bool IsRunning => false;
|
|
||||||
public bool InDirectPoint => false;
|
|
||||||
public float HitChance => SettingsReader.Instance.GetSettings.GetHitChanceInCover;
|
|
||||||
public float DoDamageChance => SettingsReader.Instance.GetSettings.DoDamageChanceInCover;
|
|
||||||
public NPC_EnumState State => NPC_EnumState.InCover;
|
|
||||||
}
|
|
68
Assets/Scripts/Character/NpcState.cs
Normal file
68
Assets/Scripts/Character/NpcState.cs
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public enum NpcEnumState
|
||||||
|
{
|
||||||
|
InCover,
|
||||||
|
InDirectPoint,
|
||||||
|
InRunning,
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum NpcBodyState
|
||||||
|
{
|
||||||
|
Crouching,
|
||||||
|
Standing,
|
||||||
|
}
|
||||||
|
|
||||||
|
public class NpcCrouchingState : INpcBaseBodyState
|
||||||
|
{
|
||||||
|
public NpcBodyState State => NpcBodyState.Crouching;
|
||||||
|
|
||||||
|
public Vector3 GetPointToHit(GameObject go)
|
||||||
|
{
|
||||||
|
MeshRenderer meshRenderer;
|
||||||
|
go.TryGetComponent<MeshRenderer>(out meshRenderer);
|
||||||
|
return meshRenderer.bounds.center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class NpcStandingState : INpcBaseBodyState
|
||||||
|
{
|
||||||
|
public NpcBodyState State => NpcBodyState.Standing;
|
||||||
|
|
||||||
|
public Vector3 GetPointToHit(GameObject go)
|
||||||
|
{
|
||||||
|
MeshRenderer meshRenderer;
|
||||||
|
go.TryGetComponent<MeshRenderer>(out meshRenderer);
|
||||||
|
return meshRenderer.bounds.center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class NpcDirectPointState : INpcBaseState
|
||||||
|
{
|
||||||
|
public bool InCover => false;
|
||||||
|
public bool IsRunning => false;
|
||||||
|
public bool InDirectPoint => false;
|
||||||
|
public float HitChance => SettingsReader.Instance.GetSettings.GetHitChanceInDirectPoint;
|
||||||
|
public float DoDamageChance => SettingsReader.Instance.GetSettings.DoDamageChanceInDirectPoint;
|
||||||
|
public NpcEnumState State => NpcEnumState.InDirectPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class NpcRunningState : INpcBaseState
|
||||||
|
{
|
||||||
|
public bool InCover => false;
|
||||||
|
public bool IsRunning => true;
|
||||||
|
public bool InDirectPoint => false;
|
||||||
|
public float HitChance => SettingsReader.Instance.GetSettings.GetHitChanceInRunning;
|
||||||
|
public float DoDamageChance => SettingsReader.Instance.GetSettings.DoDamageChanceInRunning;
|
||||||
|
public NpcEnumState State => NpcEnumState.InRunning;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class NpcInCoverState : INpcBaseState
|
||||||
|
{
|
||||||
|
public bool InCover => true;
|
||||||
|
public bool IsRunning => false;
|
||||||
|
public bool InDirectPoint => false;
|
||||||
|
public float HitChance => SettingsReader.Instance.GetSettings.GetHitChanceInCover;
|
||||||
|
public float DoDamageChance => SettingsReader.Instance.GetSettings.DoDamageChanceInCover;
|
||||||
|
public NpcEnumState State => NpcEnumState.InCover;
|
||||||
|
}
|
@ -15,9 +15,9 @@ public class Player : MonoBehaviour, ICharacter
|
|||||||
Condition = PlayerCharacter.Condition;
|
Condition = PlayerCharacter.Condition;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetCharacter()
|
private void OnDestroy()
|
||||||
{
|
{
|
||||||
Condition = new CharacterCondition();
|
Debug.LogWarning("Pooled object was destroyed");
|
||||||
}
|
}
|
||||||
|
|
||||||
public event Action<object> OnKilledEvent;
|
public event Action<object> OnKilledEvent;
|
||||||
@ -31,8 +31,8 @@ public class Player : MonoBehaviour, ICharacter
|
|||||||
OnKilledEvent?.Invoke(this);
|
OnKilledEvent?.Invoke(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDestroy()
|
public void ResetCharacter()
|
||||||
{
|
{
|
||||||
Debug.LogWarning("Pooled object was destroyed");
|
Condition = new CharacterCondition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
using System;
|
using UnityEngine;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Unity.Barracuda;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
using static scr_Models;
|
using static scr_Models;
|
||||||
|
|
||||||
@ -123,11 +119,11 @@ public class scr_CharacterController : MonoBehaviour
|
|||||||
{
|
{
|
||||||
playerSettings.SpeedEffector = playerSettings.FallingSpeedEffector;
|
playerSettings.SpeedEffector = playerSettings.FallingSpeedEffector;
|
||||||
}
|
}
|
||||||
else if(playerStance == PlayerStance.Crouch)
|
else if (playerStance == PlayerStance.Crouch)
|
||||||
{
|
{
|
||||||
playerSettings.SpeedEffector = playerSettings.CrouchSpeedEffector;
|
playerSettings.SpeedEffector = playerSettings.CrouchSpeedEffector;
|
||||||
}
|
}
|
||||||
else if(playerStance == PlayerStance.Prone)
|
else if (playerStance == PlayerStance.Prone)
|
||||||
{
|
{
|
||||||
playerSettings.SpeedEffector = playerSettings.ProneSpeedEffector;
|
playerSettings.SpeedEffector = playerSettings.ProneSpeedEffector;
|
||||||
}
|
}
|
||||||
|
@ -1,62 +1,122 @@
|
|||||||
using Unity.MLAgents;
|
using System;
|
||||||
|
using Unity.MLAgents;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System;
|
|
||||||
|
|
||||||
public class GameManager : MonoBehaviour
|
public class GameManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
private static GameManager instance;
|
private static GameManager instance;
|
||||||
public static GameManager Instance { get { return instance; } }
|
public static GameManager Instance => instance;
|
||||||
|
|
||||||
private static SimpleMultiAgentGroup DefendersTeam = new SimpleMultiAgentGroup();
|
private static SimpleMultiAgentGroup defendersTeam = new SimpleMultiAgentGroup();
|
||||||
private static SimpleMultiAgentGroup AttackersTeam = new SimpleMultiAgentGroup();
|
private static SimpleMultiAgentGroup attackersTeam = new SimpleMultiAgentGroup();
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
if (Instance == null)
|
if (instance is null)
|
||||||
instance = this;
|
instance = this;
|
||||||
else if (Instance == this)
|
else
|
||||||
|
{
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
|
Debug.LogError("Only 1 Instance");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
Academy.Instance.OnEnvironmentReset += ResetScene;
|
Academy.Instance.OnEnvironmentReset += ResetScene;
|
||||||
|
GlobalEventManager.OnCaptureFlag += FlagCaptured;
|
||||||
GlobalEventManager.onCaptureFlag += flagCaptured;
|
GlobalEventManager.OnTimeLeft += TimeOut;
|
||||||
GlobalEventManager.onTimeLeft += timeOut;
|
|
||||||
|
|
||||||
var agents = GameObject.FindObjectsOfType<Agent>();
|
var agents = GameObject.FindObjectsOfType<Agent>();
|
||||||
foreach (var item in agents)
|
foreach (var item in agents)
|
||||||
{
|
{
|
||||||
var agent = item as NPC;
|
var agent = item as NPC;
|
||||||
if (agent.GetCharacter.Team == Team.Attackers)
|
if (agent.GetCharacter.Team == Team.Attackers)
|
||||||
AttackersTeam.RegisterAgent(agent);
|
attackersTeam.RegisterAgent(item);
|
||||||
else
|
else
|
||||||
DefendersTeam.RegisterAgent(agent);
|
defendersTeam.RegisterAgent(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsCloserToEnemyThanToNextNavPoint(NavPoint navPoint, Vector3 currentTransform, Team team)
|
private static SimpleMultiAgentGroup getAgentList(Team team)
|
||||||
{
|
{
|
||||||
SimpleMultiAgentGroup agentGroup;
|
|
||||||
if (team == Team.Attackers)
|
if (team == Team.Attackers)
|
||||||
agentGroup = AttackersTeam;
|
return attackersTeam;
|
||||||
else
|
else
|
||||||
agentGroup = DefendersTeam;
|
return defendersTeam;
|
||||||
|
}
|
||||||
|
|
||||||
var distToNavPoint = (currentTransform - navPoint.position).magnitude;
|
public static bool IsCloserToEnemyThanToNextNavPoint(NavPoint navPoint, Vector3 currentTransform, Team oppositeTeam)
|
||||||
|
{
|
||||||
|
var agentGroup = getAgentList(oppositeTeam);
|
||||||
|
|
||||||
|
var distToNavPoint = (currentTransform - navPoint.Position).magnitude;
|
||||||
foreach (var agent in agentGroup.GetRegisteredAgents())
|
foreach (var agent in agentGroup.GetRegisteredAgents())
|
||||||
if (distToNavPoint > (currentTransform - agent.transform.position).magnitude)
|
if (distToNavPoint > (currentTransform - agent.transform.position).magnitude)
|
||||||
return true;
|
return true;
|
||||||
|
if ((SettingsReader.Instance.GetSettings.HasHumanAttacker == true && oppositeTeam == Team.Attackers) ||
|
||||||
|
(SettingsReader.Instance.GetSettings.HasHumanDefender == true && oppositeTeam == Team.Defenders))
|
||||||
|
{
|
||||||
|
if (distToNavPoint > (currentTransform - CharacterFactory.Instance.player.transform.position).magnitude)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsEnemyNearby(Vector3 currentTransform, Team oppositeTeam)
|
||||||
|
{
|
||||||
|
var agentGroup = getAgentList(oppositeTeam);
|
||||||
|
|
||||||
|
foreach (var agent in agentGroup.GetRegisteredAgents())
|
||||||
|
if ((currentTransform - agent.transform.position).magnitude < SettingsReader.Instance.GetSettings.ViewDistance)
|
||||||
|
return true;
|
||||||
|
if ((SettingsReader.Instance.GetSettings.HasHumanAttacker == true && oppositeTeam == Team.Attackers) ||
|
||||||
|
(SettingsReader.Instance.GetSettings.HasHumanDefender == true && oppositeTeam == Team.Defenders))
|
||||||
|
{
|
||||||
|
if ((currentTransform - CharacterFactory.Instance.player.transform.position).magnitude < SettingsReader.Instance.GetSettings.ViewDistance)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsCloserToFlagFromNextNavPoint(NavPoint navPoint, Vector3 currentTransform)
|
public static bool IsCloserToFlagFromNextNavPoint(NavPoint navPoint, Vector3 currentTransform)
|
||||||
=> navPoint.FlagDistance < (currentTransform - GameObject.FindGameObjectWithTag("Flag").transform.position).magnitude;
|
=> navPoint.FlagDistance < (currentTransform - GameObject.FindGameObjectWithTag("Flag").transform.position).magnitude;
|
||||||
|
|
||||||
private void flagCaptured(Team team)
|
public static bool IsHaveSeenByEnemy(Team oppositeTeam, Vector3 position)
|
||||||
{
|
{
|
||||||
switch(team)
|
var agentGroup = getAgentList(oppositeTeam);
|
||||||
|
RaycastHit rayHit = new RaycastHit();
|
||||||
|
foreach (var agent in agentGroup.GetRegisteredAgents() )
|
||||||
|
{
|
||||||
|
var npc = agent as NPC;
|
||||||
|
if (Physics.Raycast(position,
|
||||||
|
(npc.NpcBodyState.GetPointToHit(npc.gameObject) - position).normalized,
|
||||||
|
out rayHit,
|
||||||
|
SettingsReader.Instance.GetSettings.ViewDistance))
|
||||||
|
{
|
||||||
|
if (rayHit.collider.gameObject.GetComponent<ICharacter>() != null)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((SettingsReader.Instance.GetSettings.HasHumanAttacker == true && oppositeTeam == Team.Attackers) ||
|
||||||
|
(SettingsReader.Instance.GetSettings.HasHumanDefender == true && oppositeTeam == Team.Defenders))
|
||||||
|
{
|
||||||
|
var player = CharacterFactory.Instance.player;
|
||||||
|
if (Physics.Raycast(position,
|
||||||
|
(player.GetComponent<MeshRenderer>().bounds.center - position).normalized,
|
||||||
|
out rayHit,
|
||||||
|
SettingsReader.Instance.GetSettings.ViewDistance))
|
||||||
|
{
|
||||||
|
if (rayHit.collider.gameObject.GetComponent<ICharacter>() != null)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FlagCaptured(Team team)
|
||||||
|
{
|
||||||
|
switch (team)
|
||||||
{
|
{
|
||||||
case Team.Attackers:
|
case Team.Attackers:
|
||||||
Debug.Log("Attackers Win");
|
Debug.Log("Attackers Win");
|
||||||
@ -66,21 +126,19 @@ public class GameManager : MonoBehaviour
|
|||||||
Debug.Log("Defenders Win");
|
Debug.Log("Defenders Win");
|
||||||
ResetScene();
|
ResetScene();
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
Debug.LogError("Unexpected Team");
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
ResetScene();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void timeOut()
|
private void TimeOut()
|
||||||
{
|
{
|
||||||
Debug.Log("Time is out");
|
ResetScene();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDestroy()
|
private void OnDestroy()
|
||||||
{
|
{
|
||||||
GlobalEventManager.onCaptureFlag -= flagCaptured;
|
GlobalEventManager.OnCaptureFlag -= FlagCaptured;
|
||||||
GlobalEventManager.onTimeLeft -= timeOut;
|
GlobalEventManager.OnTimeLeft -= TimeOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static event Action OnResetScene;
|
public static event Action OnResetScene;
|
||||||
|
@ -2,18 +2,18 @@
|
|||||||
|
|
||||||
public class GlobalEventManager
|
public class GlobalEventManager
|
||||||
{
|
{
|
||||||
public static event Action<Team> onCaptureFlag;
|
public static event Action<Team> OnCaptureFlag;
|
||||||
|
|
||||||
public static void SendCaptureFlag(Team team)
|
public static void SendCaptureFlag(Team team)
|
||||||
{
|
{
|
||||||
onCaptureFlag?.Invoke(team);
|
OnCaptureFlag?.Invoke(team);
|
||||||
onCaptureFlag = null;
|
OnCaptureFlag = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static event Action onTimeLeft;
|
public static event Action OnTimeLeft;
|
||||||
public static void SendTimeout()
|
public static void SendTimeout()
|
||||||
{
|
{
|
||||||
onTimeLeft?.Invoke();
|
OnTimeLeft?.Invoke();
|
||||||
onTimeLeft = null;
|
OnTimeLeft = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,17 +3,61 @@ using UnityEngine;
|
|||||||
|
|
||||||
public class MapManager : MonoBehaviour
|
public class MapManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
public static List<NavPoint> navPoints { get; private set; }
|
private static MapManager _instance;
|
||||||
private void Start()
|
public static MapManager Instance => _instance;
|
||||||
|
[SerializeField] private List<NavPoint> _navPoints;
|
||||||
|
public List<NavPoint> NavPoints { get => _navPoints; private set => _navPoints = value; }
|
||||||
|
public Dictionary<int, NavPoint> IDToNavPoint {get; private set; }
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
{
|
{
|
||||||
var i = 0;
|
if (_instance is null)
|
||||||
navPoints = new List<NavPoint>();
|
_instance = this;
|
||||||
var navPointsGameObj = GameObject.FindGameObjectsWithTag("Point");
|
else
|
||||||
foreach (var gameobj in navPointsGameObj)
|
|
||||||
{
|
{
|
||||||
var navpoint = gameobj.GetComponent<NavPoint>();
|
Destroy(gameObject);
|
||||||
navpoint.PointId = i; i++;
|
Debug.LogError("Only 1 Instance");
|
||||||
navPoints.Add(navpoint);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NavPoints = new List<NavPoint>();
|
||||||
|
var navPointSet = GameObject.Find("NavPoint Set");
|
||||||
|
var count = navPointSet.transform.childCount;
|
||||||
|
for (var i=0; i < count; i++)
|
||||||
|
NavPoints.Add(navPointSet.transform.GetChild(i)
|
||||||
|
.gameObject.GetComponent<NavPoint>());
|
||||||
|
print(NavPoints.Count);
|
||||||
|
NavPointSetToID();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void NavPointSetToID()
|
||||||
|
{
|
||||||
|
IDToNavPoint = new Dictionary<int, NavPoint>();
|
||||||
|
int i = 0;
|
||||||
|
foreach (var navPoint in NavPoints)
|
||||||
|
{
|
||||||
|
IDToNavPoint.Add(i, navPoint);
|
||||||
|
navPoint.PointId = i;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void AddDeathAttributeToPoints(int startPoint, int endPoint,
|
||||||
|
float allDistance, float remainingDistance)
|
||||||
|
{
|
||||||
|
var startNavPoint = _instance.IDToNavPoint[startPoint];
|
||||||
|
var endNavPoint = _instance.IDToNavPoint[endPoint];
|
||||||
|
float coef;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
coef = remainingDistance / allDistance;
|
||||||
|
}
|
||||||
|
catch (System.ArithmeticException)
|
||||||
|
{
|
||||||
|
Debug.LogError("Path Length is zero");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
startNavPoint.DeathAttr += 1 - coef;
|
||||||
|
endNavPoint.DeathAttr += coef;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
using System.Collections;
|
using UnityEngine;
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class TimeManager : MonoBehaviour
|
public class TimeManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
@ -17,12 +15,14 @@ public class TimeManager : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogError("Only one Instance");
|
Debug.LogError("Only 1 Instance");
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
CurrentTime += Time.deltaTime;
|
CurrentTime += Time.deltaTime;
|
||||||
|
if (CurrentTime > SettingsReader.Instance.GetSettings.TimeOut)
|
||||||
|
GlobalEventManager.SendTimeout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
using System.Collections;
|
using UnityEngine;
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class FlagZone : MonoBehaviour
|
public class FlagZone : MonoBehaviour
|
||||||
{
|
{
|
||||||
@ -9,14 +7,14 @@ public class FlagZone : MonoBehaviour
|
|||||||
public float TimeStayDefenders { get; private set; }
|
public float TimeStayDefenders { get; private set; }
|
||||||
private int occupDefenders;
|
private int occupDefenders;
|
||||||
private int occupAttackers;
|
private int occupAttackers;
|
||||||
private bool isOccupBoth => (occupDefenders>0) && (occupAttackers>0);
|
public bool IsOccupBoth => (occupDefenders > 0) && (occupAttackers > 0);
|
||||||
private bool isNotOccup => (occupDefenders == 0) && (occupAttackers == 0);
|
public bool IsNotOccup => (occupDefenders == 0) && (occupAttackers == 0);
|
||||||
private float timeForWin;
|
private float timeForWin;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
|
|
||||||
timeForWin = SettingsReader.Instance.GetSettings.timeToWin;
|
timeForWin = SettingsReader.Instance.GetSettings.TimeToWin;
|
||||||
TimeStayAttackers = 0;
|
TimeStayAttackers = 0;
|
||||||
TimeStayDefenders = 0;
|
TimeStayDefenders = 0;
|
||||||
occupAttackers = 0;
|
occupAttackers = 0;
|
||||||
@ -24,7 +22,7 @@ public class FlagZone : MonoBehaviour
|
|||||||
}
|
}
|
||||||
private void OnTriggerEnter(Collider other)
|
private void OnTriggerEnter(Collider other)
|
||||||
{
|
{
|
||||||
switch(other.tag)
|
switch (other.tag)
|
||||||
{
|
{
|
||||||
case "Defender":
|
case "Defender":
|
||||||
occupDefenders++;
|
occupDefenders++;
|
||||||
@ -54,7 +52,7 @@ public class FlagZone : MonoBehaviour
|
|||||||
}
|
}
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (isOccupBoth || isNotOccup)
|
if (IsOccupBoth || IsNotOccup)
|
||||||
{
|
{
|
||||||
TimeStayAttackers = 0;
|
TimeStayAttackers = 0;
|
||||||
TimeStayDefenders = 0;
|
TimeStayDefenders = 0;
|
||||||
|
@ -1,21 +1,28 @@
|
|||||||
using System.Collections;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
using System;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
public enum NavPointType
|
||||||
|
{
|
||||||
|
Cover,
|
||||||
|
Direction,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public class NavPoint : MonoBehaviour
|
public class NavPoint : MonoBehaviour
|
||||||
{
|
{
|
||||||
public Vector3 position => gameObject.transform.position;
|
public Vector3 Position => gameObject.transform.position;
|
||||||
public float FlagDistance { get; private set; }
|
public float FlagDistance { get; private set; }
|
||||||
|
|
||||||
|
public NavPointType navType = NavPointType.Direction;
|
||||||
|
|
||||||
[HideInInspector]
|
[HideInInspector]
|
||||||
public int PointId;
|
public int PointId = 0;
|
||||||
public float DeathAttr = 0;
|
public float DeathAttr = 0;
|
||||||
public List<Vector3> EnemiesSeen = new List<Vector3>();
|
public List<Vector3> EnemiesSeen = new List<Vector3>();
|
||||||
//Here other attributes;
|
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
PointId = GetInstanceID();
|
FlagDistance = (GameObject.FindGameObjectWithTag("Flag").transform.position - Position).magnitude;
|
||||||
FlagDistance = (GameObject.FindGameObjectWithTag("Flag").transform.position - position).magnitude;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,32 +1,34 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
[CreateAssetMenu(fileName ="Game Settings", menuName = "Game/Settings", order = 51)]
|
[CreateAssetMenu(fileName = "Game Settings", menuName = "Game/Settings", order = 51)]
|
||||||
public class Settings : ScriptableObject
|
public class Settings : ScriptableObject
|
||||||
{
|
{
|
||||||
public bool isTesting;
|
public bool IsTesting;
|
||||||
|
|
||||||
public float timeToWin;
|
public float TimeToWin;
|
||||||
public float timeOut;
|
public float TimeOut;
|
||||||
|
|
||||||
[Header("movement")]
|
[Header("movement")]
|
||||||
public float movementDistance;
|
public float MovementDistance;
|
||||||
public float movementSpeed;
|
public float MovementSpeed;
|
||||||
|
|
||||||
public TypeAI defTeamAI;
|
public TypeAI DefTeamAI;
|
||||||
public TypeAI atcTeamAI;
|
public TypeAI AtcTeamAI;
|
||||||
public int numOfDefenders;
|
public int NumOfDefenders;
|
||||||
public int numOfAttackers;
|
public int NumOfAttackers;
|
||||||
public bool hasHumanDefender;
|
public bool HasHumanDefender;
|
||||||
public bool hasHumanAttacker;
|
public bool HasHumanAttacker;
|
||||||
|
|
||||||
public int healthPickupAmount;
|
public int HealthPickupAmount;
|
||||||
public int armourPickupAmount;
|
public int ArmourPickupAmount;
|
||||||
public int ammunitionPickupAmount;
|
public int AmmunitionPickupAmount;
|
||||||
public int pickupsAmount;
|
public int PickupsAmount;
|
||||||
|
|
||||||
public int maxHealth;
|
public int MaxHealth;
|
||||||
public int maxArmour;
|
public int MaxArmour;
|
||||||
public int maxAmmo;
|
public int MaxAmmo;
|
||||||
|
|
||||||
|
public float ViewDistance;
|
||||||
|
|
||||||
public float GetHitChanceInDirectPoint;
|
public float GetHitChanceInDirectPoint;
|
||||||
public float GetHitChanceInRunning;
|
public float GetHitChanceInRunning;
|
||||||
@ -34,4 +36,6 @@ public class Settings : ScriptableObject
|
|||||||
public float DoDamageChanceInDirectPoint;
|
public float DoDamageChanceInDirectPoint;
|
||||||
public float DoDamageChanceInRunning;
|
public float DoDamageChanceInRunning;
|
||||||
public float DoDamageChanceInCover;
|
public float DoDamageChanceInCover;
|
||||||
|
|
||||||
|
public float CrouchingCoefficient;
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,21 @@
|
|||||||
using System.Collections;
|
using UnityEngine;
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class SettingsReader : MonoBehaviour
|
public class SettingsReader : MonoBehaviour
|
||||||
{
|
{
|
||||||
private static SettingsReader instance;
|
private static SettingsReader instance;
|
||||||
public static SettingsReader Instance { get { return instance; } }
|
public static SettingsReader Instance => instance;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
|
if (instance is null)
|
||||||
instance = this;
|
instance = this;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Destroy(gameObject);
|
||||||
|
Debug.LogError("Only 1 Instance");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[SerializeField] private Settings gameSettings;
|
[SerializeField] private Settings gameSettings;
|
||||||
public Settings GetSettings { get { return gameSettings; } }
|
public Settings GetSettings => gameSettings;
|
||||||
}
|
}
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class Statistics : MonoBehaviour
|
|
||||||
{
|
|
||||||
private void Start()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using UnityEngine;
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
[RequireComponent(typeof(BoxCollider))]
|
[RequireComponent(typeof(BoxCollider))]
|
||||||
public class AmmoPickUp : MonoBehaviour, IPickable
|
public class AmmoPickUp : MonoBehaviour, IPickable
|
||||||
@ -11,9 +10,14 @@ public class AmmoPickUp : MonoBehaviour, IPickable
|
|||||||
PickObject(other.gameObject);
|
PickObject(other.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
Debug.LogWarning("Pooled object was destroyed");
|
||||||
|
}
|
||||||
|
|
||||||
public void PickObject(GameObject obj)
|
public void PickObject(GameObject obj)
|
||||||
{
|
{
|
||||||
obj.GetComponent<ICharacter>()?.GetCharacter.Condition.TakeAmmo(SettingsReader.Instance.GetSettings.ammunitionPickupAmount);
|
obj.GetComponent<ICharacter>()?.GetCharacter.Condition.TakeAmmo(SettingsReader.Instance.GetSettings.AmmunitionPickupAmount);
|
||||||
gameObject.SetActive(false);
|
gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using UnityEngine;
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
[RequireComponent(typeof(BoxCollider))]
|
[RequireComponent(typeof(BoxCollider))]
|
||||||
public class ArmourPickUp : MonoBehaviour, IPickable
|
public class ArmourPickUp : MonoBehaviour, IPickable
|
||||||
@ -11,9 +10,14 @@ public class ArmourPickUp : MonoBehaviour, IPickable
|
|||||||
PickObject(other.gameObject);
|
PickObject(other.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
Debug.LogWarning("Pooled object was destroyed");
|
||||||
|
}
|
||||||
|
|
||||||
public void PickObject(GameObject obj)
|
public void PickObject(GameObject obj)
|
||||||
{
|
{
|
||||||
obj.GetComponent<ICharacter>()?.GetCharacter.Condition.GiveArmour(SettingsReader.Instance.GetSettings.armourPickupAmount);
|
obj.GetComponent<ICharacter>()?.GetCharacter.Condition.GiveArmour(SettingsReader.Instance.GetSettings.ArmourPickupAmount);
|
||||||
gameObject.SetActive(false);
|
gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using UnityEngine;
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
[RequireComponent(typeof(BoxCollider))]
|
[RequireComponent(typeof(BoxCollider))]
|
||||||
public class HealthPickUp : MonoBehaviour, IPickable
|
public class HealthPickUp : MonoBehaviour, IPickable
|
||||||
@ -11,9 +10,14 @@ public class HealthPickUp : MonoBehaviour, IPickable
|
|||||||
PickObject(other.gameObject);
|
PickObject(other.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
Debug.LogWarning("Pooled object was destroyed");
|
||||||
|
}
|
||||||
|
|
||||||
public void PickObject(GameObject obj)
|
public void PickObject(GameObject obj)
|
||||||
{
|
{
|
||||||
obj.GetComponent<ICharacter>()?.GetCharacter.Condition.GiveHealth(SettingsReader.Instance.GetSettings.healthPickupAmount);
|
obj.GetComponent<ICharacter>()?.GetCharacter.Condition.GiveHealth(SettingsReader.Instance.GetSettings.HealthPickupAmount);
|
||||||
gameObject.SetActive(false);
|
gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using UnityEngine;
|
||||||
using UnityEngine;
|
|
||||||
public interface IPickable
|
public interface IPickable
|
||||||
{
|
{
|
||||||
PickUpType type { get; }
|
PickUpType type { get; }
|
||||||
|
@ -27,7 +27,7 @@ public class PickUpSpawner : MonoBehaviour
|
|||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
pickups = new List<GameObject>();
|
pickups = new List<GameObject>();
|
||||||
var amount = SettingsReader.Instance.GetSettings.pickupsAmount;
|
var amount = SettingsReader.Instance.GetSettings.PickupsAmount;
|
||||||
for (int i = 0; i < amount; i++)
|
for (int i = 0; i < amount; i++)
|
||||||
pickups.Add(GameObject.Instantiate(healthPrefab, spawnPoints[Random.Range(0, spawnPoints.Count)].transform.position, Quaternion.identity));
|
pickups.Add(GameObject.Instantiate(healthPrefab, spawnPoints[Random.Range(0, spawnPoints.Count)].transform.position, Quaternion.identity));
|
||||||
for (int i = 0; i < amount; i++)
|
for (int i = 0; i < amount; i++)
|
||||||
@ -44,15 +44,15 @@ public class PickUpSpawner : MonoBehaviour
|
|||||||
|
|
||||||
private IEnumerator SpawnNewPickUps()
|
private IEnumerator SpawnNewPickUps()
|
||||||
{
|
{
|
||||||
while(true)
|
while (true)
|
||||||
{
|
{
|
||||||
GameObject item;
|
GameObject item;
|
||||||
if(IsDisableCheck(out item))
|
if (IsDisableCheck(out item))
|
||||||
{
|
{
|
||||||
yield return new WaitForSeconds(3);
|
yield return new WaitForSeconds(3);
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
item.transform.position = spawnPoints[Random.Range(0, spawnPoints.Count)].position;
|
item.transform.position = spawnPoints[Random.Range(0, spawnPoints.Count)].Position;
|
||||||
item.SetActive(true);
|
item.SetActive(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ public class PickUpSpawner : MonoBehaviour
|
|||||||
|
|
||||||
private bool IsDisableCheck(out GameObject gameobj)
|
private bool IsDisableCheck(out GameObject gameobj)
|
||||||
{
|
{
|
||||||
foreach(var pick in pickups)
|
foreach (var pick in pickups)
|
||||||
{
|
{
|
||||||
if (!pick.activeInHierarchy)
|
if (!pick.activeInHierarchy)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
public enum SensorType
|
|
||||||
{
|
|
||||||
Visual,
|
|
||||||
Sound,
|
|
||||||
Other
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using Unity.MLAgents.Sensors;
|
|
||||||
|
|
||||||
|
|
8
Assets/Scripts/Statistics.meta
generated
Normal file
8
Assets/Scripts/Statistics.meta
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3a9f7f0a9faf11f49a433480722bffc5
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
19
Assets/Scripts/Statistics/Logger.cs
Normal file
19
Assets/Scripts/Statistics/Logger.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using System.IO;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class Logger
|
||||||
|
{
|
||||||
|
private const string Directory = "/Logs/";
|
||||||
|
private const string BaseName = "Log#";
|
||||||
|
|
||||||
|
public static void SaveLog<T>(T objToSerialize)
|
||||||
|
{
|
||||||
|
var dir = Application.persistentDataPath + Directory;
|
||||||
|
if (!System.IO.Directory.Exists(dir))
|
||||||
|
System.IO.Directory.CreateDirectory(dir);
|
||||||
|
|
||||||
|
var logName = BaseName + (System.IO.Directory.GetFiles(dir).Length + 1).ToString();
|
||||||
|
var json = JsonUtility.ToJson(objToSerialize);
|
||||||
|
File.WriteAllText(dir + logName, json);
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/Statistics/Logger.cs.meta
generated
Normal file
11
Assets/Scripts/Statistics/Logger.cs.meta
generated
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b3a1cec894fa98b4bbe20470f1e316c4
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
51
Assets/Scripts/Statistics/StatisticManager.cs
Normal file
51
Assets/Scripts/Statistics/StatisticManager.cs
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
internal class Log
|
||||||
|
{
|
||||||
|
public int damageTakenByDefs = 0;
|
||||||
|
public int damageTakenByAtc = 0;
|
||||||
|
|
||||||
|
public int AtcWin = 0;
|
||||||
|
public int DefWin = 0;
|
||||||
|
|
||||||
|
public int TimeOuts = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class StatisticManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
private Log log = new Log();
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
foreach (var npc in GameObject.FindObjectsOfType<NPC>())
|
||||||
|
npc.OnDamageRecieved += RegisterDamage;
|
||||||
|
|
||||||
|
GlobalEventManager.OnCaptureFlag += RegisterWin;
|
||||||
|
GlobalEventManager.OnTimeLeft += RegisterTimeOut;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RegisterDamage(int damage, Team team)
|
||||||
|
{
|
||||||
|
if (team == Team.Attackers)
|
||||||
|
log.damageTakenByAtc += damage;
|
||||||
|
else
|
||||||
|
log.damageTakenByDefs += damage;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RegisterWin(Team team)
|
||||||
|
{
|
||||||
|
if (team == Team.Attackers)
|
||||||
|
log.AtcWin += 1;
|
||||||
|
else
|
||||||
|
log.DefWin += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RegisterTimeOut()
|
||||||
|
{
|
||||||
|
log.TimeOuts += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnApplicationQuit()
|
||||||
|
{
|
||||||
|
Logger.SaveLog<Log>(log);
|
||||||
|
}
|
||||||
|
}
|
0
Assets/Scripts/Misc/Statistics.cs.meta → Assets/Scripts/Statistics/StatisticManager.cs.meta
generated
Executable file → Normal file
0
Assets/Scripts/Misc/Statistics.cs.meta → Assets/Scripts/Statistics/StatisticManager.cs.meta
generated
Executable file → Normal file
7
Assets/Scripts/Utils/BoolToInteger.cs
Normal file
7
Assets/Scripts/Utils/BoolToInteger.cs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
public static class BoolExtension
|
||||||
|
{
|
||||||
|
public static int ToInt(this bool _bool)
|
||||||
|
{
|
||||||
|
return _bool == true ? 1 : 0;
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/Utils/BoolToInteger.cs.meta
generated
Normal file
11
Assets/Scripts/Utils/BoolToInteger.cs.meta
generated
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f48fff3c2eda14d4fba923fe8875f651
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -1,10 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using UnityEngine;
|
using System.Linq;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
using UnityObject = UnityEngine.Object;
|
using UnityObject = UnityEngine.Object;
|
||||||
|
|
||||||
[Serializable, DebuggerDisplay("Count = {Count}")]
|
[Serializable, DebuggerDisplay("Count = {Count}")]
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using UnityEngine;
|
||||||
using UnityEngine;
|
|
||||||
using static scr_Models;
|
using static scr_Models;
|
||||||
public class scr_WeaponController : MonoBehaviour
|
public class scr_WeaponController : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
50
Assets/Settings/Game Settings.asset
generated
50
Assets/Settings/Game Settings.asset
generated
@ -12,27 +12,29 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: e2c47233b9062c84482336b145c6891b, type: 3}
|
m_Script: {fileID: 11500000, guid: e2c47233b9062c84482336b145c6891b, type: 3}
|
||||||
m_Name: Game Settings
|
m_Name: Game Settings
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
isTesting: 1
|
IsTesting: 0
|
||||||
timeToWin: 5
|
TimeToWin: 15
|
||||||
timeOut: 1600
|
TimeOut: 3600
|
||||||
movementDistance: 50
|
MovementDistance: 50
|
||||||
movementSpeed: 3
|
MovementSpeed: 5
|
||||||
defTeamAI: 0
|
DefTeamAI: 3
|
||||||
atcTeamAI: 0
|
AtcTeamAI: 3
|
||||||
numOfDefenders: 1
|
NumOfDefenders: 1
|
||||||
numOfAttackers: 1
|
NumOfAttackers: 1
|
||||||
hasHumanDefender: 1
|
HasHumanDefender: 0
|
||||||
hasHumanAttacker: 0
|
HasHumanAttacker: 0
|
||||||
healthPickupAmount: 50
|
HealthPickupAmount: 50
|
||||||
armourPickupAmount: 50
|
ArmourPickupAmount: 50
|
||||||
ammunitionPickupAmount: 120
|
AmmunitionPickupAmount: 60
|
||||||
pickupsAmount: 2
|
PickupsAmount: 0
|
||||||
maxHealth: 100
|
MaxHealth: 100
|
||||||
maxArmour: 100
|
MaxArmour: 100
|
||||||
maxAmmo: 31337
|
MaxAmmo: 360
|
||||||
GetHitChanceInDirectPoint: 0
|
ViewDistance: 100
|
||||||
GetHitChanceInRunning: 0
|
GetHitChanceInDirectPoint: 50
|
||||||
GetHitChanceInCover: 0
|
GetHitChanceInRunning: 25
|
||||||
DoDamageChanceInDirectPoint: 0
|
GetHitChanceInCover: 20
|
||||||
DoDamageChanceInRunning: 0
|
DoDamageChanceInDirectPoint: 70
|
||||||
DoDamageChanceInCover: 0
|
DoDamageChanceInRunning: 30
|
||||||
|
DoDamageChanceInCover: 25
|
||||||
|
CrouchingCoefficient: 1.4
|
||||||
|
@ -1,17 +1,24 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"com.unity.2d.sprite": "1.0.0",
|
||||||
|
"com.unity.2d.tilemap": "1.0.0",
|
||||||
|
"com.unity.ads": "3.7.5",
|
||||||
|
"com.unity.analytics": "3.6.12",
|
||||||
"com.unity.collab-proxy": "1.14.12",
|
"com.unity.collab-proxy": "1.14.12",
|
||||||
"com.unity.ide.rider": "1.2.1",
|
"com.unity.ide.rider": "1.2.1",
|
||||||
"com.unity.ide.visualstudio": "2.0.14",
|
"com.unity.ide.visualstudio": "2.0.14",
|
||||||
"com.unity.ide.vscode": "1.2.4",
|
"com.unity.ide.vscode": "1.2.4",
|
||||||
"com.unity.inputsystem": "1.3.0",
|
"com.unity.inputsystem": "1.3.0",
|
||||||
"com.unity.ml-agents": "2.0.1",
|
"com.unity.ml-agents": "2.0.1",
|
||||||
|
"com.unity.multiplayer-hlapi": "1.0.8",
|
||||||
"com.unity.probuilder": "4.5.2",
|
"com.unity.probuilder": "4.5.2",
|
||||||
|
"com.unity.purchasing": "4.1.2",
|
||||||
"com.unity.test-framework": "1.1.30",
|
"com.unity.test-framework": "1.1.30",
|
||||||
"com.unity.textmeshpro": "2.1.6",
|
"com.unity.textmeshpro": "2.1.6",
|
||||||
"com.unity.timeline": "1.2.18",
|
"com.unity.timeline": "1.2.18",
|
||||||
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.0",
|
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.0",
|
||||||
"com.unity.ugui": "1.0.0",
|
"com.unity.ugui": "1.0.0",
|
||||||
|
"com.unity.xr.legacyinputhelpers": "2.1.8",
|
||||||
"com.unity.modules.ai": "1.0.0",
|
"com.unity.modules.ai": "1.0.0",
|
||||||
"com.unity.modules.androidjni": "1.0.0",
|
"com.unity.modules.androidjni": "1.0.0",
|
||||||
"com.unity.modules.animation": "1.0.0",
|
"com.unity.modules.animation": "1.0.0",
|
||||||
|
@ -1,5 +1,35 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"com.unity.2d.sprite": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.2d.tilemap": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
|
"com.unity.ads": {
|
||||||
|
"version": "3.7.5",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.ugui": "1.0.0"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.analytics": {
|
||||||
|
"version": "3.6.12",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.ugui": "1.0.0"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
"com.unity.barracuda": {
|
"com.unity.barracuda": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
@ -86,6 +116,15 @@
|
|||||||
},
|
},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
|
"com.unity.multiplayer-hlapi": {
|
||||||
|
"version": "1.0.8",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"nuget.mono-cecil": "0.1.6-preview"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
"com.unity.probuilder": {
|
"com.unity.probuilder": {
|
||||||
"version": "4.5.2",
|
"version": "4.5.2",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
@ -95,6 +134,29 @@
|
|||||||
},
|
},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
|
"com.unity.purchasing": {
|
||||||
|
"version": "4.1.2",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.ugui": "1.0.0",
|
||||||
|
"com.unity.modules.unityanalytics": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||||
|
"com.unity.modules.jsonserialize": "1.0.0",
|
||||||
|
"com.unity.modules.androidjni": "1.0.0",
|
||||||
|
"com.unity.services.core": "1.0.1"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"com.unity.services.core": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"depth": 1,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.unitywebrequest": "1.0.0"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
"com.unity.settings-manager": {
|
"com.unity.settings-manager": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
@ -169,6 +231,23 @@
|
|||||||
"com.unity.modules.imgui": "1.0.0"
|
"com.unity.modules.imgui": "1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"com.unity.xr.legacyinputhelpers": {
|
||||||
|
"version": "2.1.8",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {
|
||||||
|
"com.unity.modules.vr": "1.0.0",
|
||||||
|
"com.unity.modules.xr": "1.0.0"
|
||||||
|
},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
|
"nuget.mono-cecil": {
|
||||||
|
"version": "0.1.6-preview",
|
||||||
|
"depth": 1,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
"com.unity.modules.ai": {
|
"com.unity.modules.ai": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
|
6
ProjectSettings/ProjectSettings.asset
generated
6
ProjectSettings/ProjectSettings.asset
generated
@ -614,7 +614,11 @@ PlayerSettings:
|
|||||||
webGLLinkerTarget: 1
|
webGLLinkerTarget: 1
|
||||||
webGLThreadsSupport: 0
|
webGLThreadsSupport: 0
|
||||||
webGLWasmStreaming: 0
|
webGLWasmStreaming: 0
|
||||||
scriptingDefineSymbols: {}
|
scriptingDefineSymbols:
|
||||||
|
1: CROSS_PLATFORM_INPUT
|
||||||
|
4: CROSS_PLATFORM_INPUT;MOBILE_INPUT
|
||||||
|
7: CROSS_PLATFORM_INPUT;MOBILE_INPUT
|
||||||
|
14: MOBILE_INPUT
|
||||||
platformArchitecture: {}
|
platformArchitecture: {}
|
||||||
scriptingBackend: {}
|
scriptingBackend: {}
|
||||||
il2cppCompilerConfiguration: {}
|
il2cppCompilerConfiguration: {}
|
||||||
|
0
ProjectSettings/ProjectVersion.txt
Executable file → Normal file
0
ProjectSettings/ProjectVersion.txt
Executable file → Normal file
7477
StyleCop.Cache
Normal file
7477
StyleCop.Cache
Normal file
File diff suppressed because it is too large
Load Diff
20623
test-ml-agents.ipynb
Normal file
20623
test-ml-agents.ipynb
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user