diff --git a/Assets/_Scenes/DevRoom.unity b/Assets/_Scenes/DevRoom.unity index 7cbab7f8e6e092d35e843df5c38e8df5a10442c3..e5fc88215f9b01f9856ff15cadf6f35eff45eabc 100644 --- a/Assets/_Scenes/DevRoom.unity +++ b/Assets/_Scenes/DevRoom.unity @@ -396,7 +396,7 @@ MonoBehaviour: meshQuery: layers: 16777223 maskAndChannels: 234881031 - surfaceParameter: 49226 + surfaceParameter: 50582 meshQueryIndex: 6 subMeshQueryIndex: 0 geometryHashValue: 3240074839323548863 @@ -939,7 +939,7 @@ MonoBehaviour: meshQuery: layers: 16777223 maskAndChannels: 234881031 - surfaceParameter: 49080 + surfaceParameter: 50438 meshQueryIndex: 7 subMeshQueryIndex: 0 geometryHashValue: 3008546525906852216 @@ -2746,6 +2746,10 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 1835324898} m_Modifications: + - target: {fileID: 4187848840791600618, guid: bbf8b8bb5e2f2e04e93f5beaf9fc2d42, type: 3} + propertyPath: aiController.patrolRoute.Array.size + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8068653259312230018, guid: bbf8b8bb5e2f2e04e93f5beaf9fc2d42, type: 3} propertyPath: m_LocalPosition.x value: 5 @@ -2792,13 +2796,48 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8116154848368178863, guid: bbf8b8bb5e2f2e04e93f5beaf9fc2d42, type: 3} propertyPath: m_IsActive - value: 1 + value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: bbf8b8bb5e2f2e04e93f5beaf9fc2d42, type: 3} +--- !u!1 &353085587 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 353085588} + m_Layer: 0 + m_Name: PatrolRoute1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &353085588 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353085587} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1879317986} + - {fileID: 948139347} + - {fileID: 1282120108} + - {fileID: 1092080185} + m_Father: {fileID: 580745004} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &354420147 GameObject: m_ObjectHideFlags: 0 @@ -2854,102 +2893,6 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &388658408 -GameObject: - m_ObjectHideFlags: 17 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 388658411} - - component: {fileID: 388658410} - - component: {fileID: 388658409} - m_Layer: 0 - m_Name: '[default-CSGModel]' - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 124 - m_IsActive: 1 ---- !u!54 &388658409 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 388658408} - serializedVersion: 4 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: 0.05 - m_CenterOfMass: {x: 0, y: 0, z: 0} - m_InertiaTensor: {x: 1, y: 1, z: 1} - m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ImplicitCom: 1 - m_ImplicitTensor: 1 - m_UseGravity: 0 - m_IsKinematic: 1 - m_Interpolate: 0 - m_Constraints: 126 - m_CollisionDetection: 0 ---- !u!114 &388658410 -MonoBehaviour: - m_ObjectHideFlags: 17 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 388658408} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8672dcc90e16b0a489a41edf56e016f8, type: 3} - m_Name: - m_EditorClassIdentifier: - PrefabBehaviour: 0 - PrefabSourceAlignment: 4 - PrefabDestinationAlignment: 0 - Version: 1.1 - infiniteBrush: {fileID: 0} - Settings: 1025 - VertexChannels: 14 - ReceiveGI: 2 - MeshColliderCookingOptions: 14 - ShowGeneratedMeshes: 0 - DefaultPhysicsMaterial: {fileID: 13400000, guid: 0c5fdfb44d6f19646a41a0720fbf751a, type: 2} - exportType: 0 - originType: 0 - exportColliders: 0 - exportPath: - angleError: 1 - areaError: 1 - hardAngle: 60 - packMargin: 20 - scaleInLightmap: 1 - autoUVMaxDistance: 0.5 - autoUVMaxAngle: 89 - minimumChartSize: 4 ---- !u!4 &388658411 -Transform: - m_ObjectHideFlags: 17 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 388658408} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 668924193} - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &437116564 GameObject: m_ObjectHideFlags: 0 @@ -3903,6 +3846,7 @@ Transform: - {fileID: 464623401} - {fileID: 1865863196} - {fileID: 1611952788} + - {fileID: 353085588} m_Father: {fileID: 1993262143} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &580745005 @@ -4254,7 +4198,7 @@ MonoBehaviour: meshQuery: layers: 33554440 maskAndChannels: 8 - surfaceParameter: 49046 + surfaceParameter: 50400 meshQueryIndex: 2 subMeshQueryIndex: 0 geometryHashValue: -1365392548276624071 @@ -4525,53 +4469,6 @@ MonoBehaviour: - EdgeIndices: 14000000150000001600000017000000 TexGenIndex: 5 Generation: 33 ---- !u!1 &668924192 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 668924193} - - component: {fileID: 668924194} - m_Layer: 0 - m_Name: '[generated-meshes]' - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &668924193 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 668924192} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 388658411} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &668924194 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 668924192} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5c3643d4978096d4880d7edbf4f65a50, type: 3} - m_Name: - m_EditorClassIdentifier: - Version: 1 - owner: {fileID: 388658410} - helperSurfaces: [] --- !u!1 &672789323 GameObject: m_ObjectHideFlags: 0 @@ -5386,7 +5283,7 @@ MonoBehaviour: meshQuery: layers: 33554440 maskAndChannels: 8 - surfaceParameter: 49046 + surfaceParameter: 50400 meshQueryIndex: 2 subMeshQueryIndex: 0 geometryHashValue: -1365392548276624071 @@ -6006,6 +5903,37 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c21e0108f08f0d74b92e3576ec7a7ecc, type: 3} +--- !u!1 &948139346 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 948139347} + m_Layer: 0 + m_Name: 2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &948139347 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 948139346} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 58, y: 0, z: -58.5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 353085588} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &954295819 GameObject: m_ObjectHideFlags: 0 @@ -6477,6 +6405,11 @@ MonoBehaviour: - EdgeIndices: 14000000150000001600000017000000 TexGenIndex: 5 Generation: 33 +--- !u!4 &1002885659 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 8068653259312230018, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + m_PrefabInstance: {fileID: 1351909661} + m_PrefabAsset: {fileID: 0} --- !u!43 &1040530778 Mesh: m_ObjectHideFlags: 16 @@ -6870,7 +6803,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8491347043216026353, guid: 7e312250336c0244193b4b75151d4fe3, type: 3} propertyPath: m_IsActive - value: 1 + value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] @@ -7138,6 +7071,37 @@ MonoBehaviour: - EdgeIndices: 14000000150000001600000017000000 TexGenIndex: 5 Generation: 33 +--- !u!1 &1092080184 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1092080185} + m_Layer: 0 + m_Name: 4 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1092080185 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1092080184} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 43, y: 0, z: 59} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 353085588} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1094297156 GameObject: m_ObjectHideFlags: 0 @@ -7506,7 +7470,7 @@ MonoBehaviour: meshQuery: layers: 16777223 maskAndChannels: 234881031 - surfaceParameter: 49116 + surfaceParameter: 50474 meshQueryIndex: 0 subMeshQueryIndex: 0 geometryHashValue: -2436489981782101099 @@ -8782,6 +8746,37 @@ MonoBehaviour: - EdgeIndices: 14000000150000001600000017000000 TexGenIndex: 5 Generation: 33 +--- !u!1 &1282120107 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1282120108} + m_Layer: 0 + m_Name: 3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1282120108 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1282120107} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 58, y: 0, z: 59} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 353085588} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1298502548 GameObject: m_ObjectHideFlags: 0 @@ -9150,6 +9145,83 @@ MonoBehaviour: - EdgeIndices: 14000000150000001600000017000000 TexGenIndex: 5 Generation: 33 +--- !u!1001 &1351909661 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1835324898} + m_Modifications: + - target: {fileID: 4187848840791600618, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: aiController.patrolRoute.Array.size + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 4187848840791600618, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: 'aiController.patrolRoute.Array.data[0]' + value: + objectReference: {fileID: 1879317986} + - target: {fileID: 4187848840791600618, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: 'aiController.patrolRoute.Array.data[1]' + value: + objectReference: {fileID: 948139347} + - target: {fileID: 4187848840791600618, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: 'aiController.patrolRoute.Array.data[2]' + value: + objectReference: {fileID: 1282120108} + - target: {fileID: 4187848840791600618, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: 'aiController.patrolRoute.Array.data[3]' + value: + objectReference: {fileID: 1092080185} + - target: {fileID: 8068653259312230018, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: m_LocalPosition.x + value: 44.090878 + objectReference: {fileID: 0} + - target: {fileID: 8068653259312230018, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8068653259312230018, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: m_LocalPosition.z + value: 7.5027514 + objectReference: {fileID: 0} + - target: {fileID: 8068653259312230018, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8068653259312230018, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8068653259312230018, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8068653259312230018, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 8068653259312230018, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8068653259312230018, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 180 + objectReference: {fileID: 0} + - target: {fileID: 8068653259312230018, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8116154848368178863, guid: 63009b5528003a4469e908d291dff8a9, type: 3} + propertyPath: m_Name + value: PatrolGoon + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 63009b5528003a4469e908d291dff8a9, type: 3} --- !u!1 &1473232142 GameObject: m_ObjectHideFlags: 0 @@ -9528,7 +9600,7 @@ MonoBehaviour: meshQuery: layers: 16777223 maskAndChannels: 234881031 - surfaceParameter: 48706 + surfaceParameter: 50062 meshQueryIndex: 8 subMeshQueryIndex: 0 geometryHashValue: 6467234982613496563 @@ -10027,6 +10099,102 @@ MonoBehaviour: m_MinRegionArea: 2 m_NavMeshData: {fileID: 23800000, guid: 6a2cc2015181cbe49bdf14754d091c1e, type: 2} m_BuildHeightMesh: 0 +--- !u!1 &1615555676 +GameObject: + m_ObjectHideFlags: 17 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1615555679} + - component: {fileID: 1615555678} + - component: {fileID: 1615555677} + m_Layer: 0 + m_Name: '[default-CSGModel]' + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 124 + m_IsActive: 1 +--- !u!54 &1615555677 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1615555676} + serializedVersion: 4 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 0 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 126 + m_CollisionDetection: 0 +--- !u!114 &1615555678 +MonoBehaviour: + m_ObjectHideFlags: 17 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1615555676} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8672dcc90e16b0a489a41edf56e016f8, type: 3} + m_Name: + m_EditorClassIdentifier: + PrefabBehaviour: 0 + PrefabSourceAlignment: 4 + PrefabDestinationAlignment: 0 + Version: 1.1 + infiniteBrush: {fileID: 0} + Settings: 1025 + VertexChannels: 14 + ReceiveGI: 2 + MeshColliderCookingOptions: 14 + ShowGeneratedMeshes: 0 + DefaultPhysicsMaterial: {fileID: 13400000, guid: 0c5fdfb44d6f19646a41a0720fbf751a, type: 2} + exportType: 0 + originType: 0 + exportColliders: 0 + exportPath: + angleError: 1 + areaError: 1 + hardAngle: 60 + packMargin: 20 + scaleInLightmap: 1 + autoUVMaxDistance: 0.5 + autoUVMaxAngle: 89 + minimumChartSize: 4 +--- !u!4 &1615555679 +Transform: + m_ObjectHideFlags: 17 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1615555676} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1954889776} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!43 &1635427727 Mesh: m_ObjectHideFlags: 0 @@ -10355,7 +10523,7 @@ MonoBehaviour: meshQuery: layers: 16777223 maskAndChannels: 234881031 - surfaceParameter: 48378 + surfaceParameter: 49740 meshQueryIndex: 1 subMeshQueryIndex: 0 geometryHashValue: 8624144165243009415 @@ -11734,6 +11902,7 @@ Transform: - {fileID: 1679100259} - {fileID: 1489131867} - {fileID: 1042174272} + - {fileID: 1002885659} m_Father: {fileID: 1993262143} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1835324899 @@ -12126,7 +12295,7 @@ MonoBehaviour: meshQuery: layers: 16777223 maskAndChannels: 234881031 - surfaceParameter: 48548 + surfaceParameter: 49906 meshQueryIndex: 9 subMeshQueryIndex: 0 geometryHashValue: -2774585206094123893 @@ -12136,6 +12305,37 @@ MonoBehaviour: HasGeneratedNormals: 0 HasUV2: 0 LightingHashValue: 0 +--- !u!1 &1879317985 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1879317986} + m_Layer: 0 + m_Name: 1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1879317986 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1879317985} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 38.5, y: 0, z: -58.5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 353085588} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1899092099 GameObject: m_ObjectHideFlags: 0 @@ -12189,6 +12389,53 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1954889775 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1954889776} + - component: {fileID: 1954889777} + m_Layer: 0 + m_Name: '[generated-meshes]' + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1954889776 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1954889775} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1615555679} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1954889777 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1954889775} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5c3643d4978096d4880d7edbf4f65a50, type: 3} + m_Name: + m_EditorClassIdentifier: + Version: 1 + owner: {fileID: 1615555678} + helperSurfaces: [] --- !u!1 &1993262141 GameObject: m_ObjectHideFlags: 0 @@ -18129,6 +18376,10 @@ PrefabInstance: propertyPath: m_Name value: HeadGoon objectReference: {fileID: 0} + - target: {fileID: 1633179406371402833, guid: 6bbd1cf0f3b1c0a47b829b17d85e8529, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -18186,6 +18437,10 @@ PrefabInstance: propertyPath: m_Name value: General objectReference: {fileID: 0} + - target: {fileID: 8311580720870795455, guid: 49a58f77228fc1844b97a3403b1cbc8f, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -18243,6 +18498,10 @@ PrefabInstance: propertyPath: m_Name value: King objectReference: {fileID: 0} + - target: {fileID: 5459024695530754787, guid: 80b7b1ac5a0a72044b8c3c65220687d7, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -18302,7 +18561,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8116154848368178863, guid: 63009b5528003a4469e908d291dff8a9, type: 3} propertyPath: m_IsActive - value: 1 + value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] @@ -18318,4 +18577,4 @@ SceneRoots: - {fileID: 1899092101} - {fileID: 683164257} - {fileID: 1298502551} - - {fileID: 388658411} + - {fileID: 1615555679} diff --git a/Assets/_Scripts/Core/Entities/Mobs/General/General.cs b/Assets/_Scripts/Core/Entities/Mobs/General/General.cs index 9c5c71b6242d91baadf73c178ba650c821371e22..f672ef28e53dedd1a15e299b052cf9ab9ade7a05 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/General/General.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/General/General.cs @@ -76,10 +76,11 @@ public class General : BossEntity Destroy(gameObject); } - // Debugging purposes + // Debugging functions protected new void OnDrawGizmosSelected() { base.OnDrawGizmosSelected(); stateController.VisualizeDetection(this); + stateController.VisualizePatrolRoute(this); } } \ No newline at end of file diff --git a/Assets/_Scripts/Core/Entities/Mobs/General/GeneralAIController.cs b/Assets/_Scripts/Core/Entities/Mobs/General/GeneralAIController.cs index 2b5544ff4ec682c4be60f69925614b37393db6bb..c0cadc225a8e379f8c63419a9ad75a99501ae8c6 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/General/GeneralAIController.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/General/GeneralAIController.cs @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; @@ -14,6 +15,9 @@ public class GeneralAIController [HideInInspector] public NavMeshAgent nav; protected float attackWindowSize = 0.3f; protected Coroutine attackWindowCoroutine; + protected int patrolIndex = 0; + public float patrolSpeed = 3; + public List<Transform> patrolRoute; // Constructor public void Init(General general) @@ -29,6 +33,23 @@ public class GeneralAIController { switch (GeneralState.GetAIState(general.stateController.State)) { + case GeneralState.AI_PATROL_STATE: + if(patrolRoute.Count > 0) + { + GoToward(patrolRoute[patrolIndex]); + if(Vector3.Distance(patrolRoute[patrolIndex].position, general.transform.position) < 0.1) + { + if(patrolIndex < patrolRoute.Count) + { + patrolIndex++; + } + else + { + patrolIndex = 0; + } + } + } + break; case GeneralState.AI_DETECTED_STATE: GoToward(GameController.Instance.player.transform); break; diff --git a/Assets/_Scripts/Core/Entities/Mobs/General/GeneralState.cs b/Assets/_Scripts/Core/Entities/Mobs/General/GeneralState.cs index 09fc7f0639fb0c55069134b40829a08d58378a46..4038d4c25de6ad034c5f7f671f18cd1b68abe733 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/General/GeneralState.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/General/GeneralState.cs @@ -1,11 +1,12 @@ public class GeneralState : CombatantEntityState { - public const int AI_DETECTED_STATE = 128; - public const int AI_IN_RANGE_STATE = 256; - public const int AI_IN_RANGE_CLOSE_STATE = 256; + public const int AI_PATROL_STATE = 128; + public const int AI_DETECTED_STATE = 256; + public const int AI_IN_RANGE_STATE = 512; + public const int AI_IN_RANGE_CLOSE_STATE = 1024; public static int GetAIState(int state) { - return state & (AI_DETECTED_STATE | AI_IN_RANGE_STATE | AI_IN_RANGE_CLOSE_STATE); + return state & (AI_PATROL_STATE | AI_DETECTED_STATE | AI_IN_RANGE_STATE | AI_IN_RANGE_CLOSE_STATE); } } \ No newline at end of file diff --git a/Assets/_Scripts/Core/Entities/Mobs/General/GeneralStateController.cs b/Assets/_Scripts/Core/Entities/Mobs/General/GeneralStateController.cs index 653a8cb10435321451333aee3d793f8c29d52dc4..af86d56b342305f3b4065b4c3cb8b453402a1579 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/General/GeneralStateController.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/General/GeneralStateController.cs @@ -51,12 +51,18 @@ public class GeneralStateController : EntityStateController } else if(Vector3.Distance(general.Position, GameController.Instance.player.Position) < detectionDistance) { - if(GeneralState.GetAIState(state) == 0) + if(GeneralState.GetAIState(state) < GeneralState.AI_DETECTED_STATE) { general.audioController.Play(General.AUDIO_CRY_KEY); } + general.aiController.nav.speed = general.Speed; aiState = GeneralState.AI_DETECTED_STATE; } + else + { + general.aiController.nav.speed = general.aiController.patrolSpeed; + aiState = GeneralState.AI_PATROL_STATE; + } // Get attackState int attackState = 0; @@ -116,7 +122,7 @@ public class GeneralStateController : EntityStateController } - // Debugging purposes + // Debugging functions public void VisualizeDetection(MonoBehaviour monoBehaviour) { Gizmos.color = Color.yellow; @@ -126,4 +132,14 @@ public class GeneralStateController : EntityStateController Gizmos.color = Color.red; Gizmos.DrawWireSphere(monoBehaviour.transform.position, attackDistance); } + + public void VisualizePatrolRoute(General general) + { + Gizmos.color = Color.cyan; + for (int i = 0; i < general.aiController.patrolRoute.Count - 1; i++) + { + Gizmos.DrawLine(general.aiController.patrolRoute[i].position, general.aiController.patrolRoute[i + 1].position); + } + Gizmos.DrawLine(general.aiController.patrolRoute[^1].position, general.aiController.patrolRoute[0].position); + } } diff --git a/Assets/_Scripts/Core/Entities/Mobs/Goon/Goon.cs b/Assets/_Scripts/Core/Entities/Mobs/Goon/Goon.cs index fb44f1b2c6138e5e2fc1b5c1fbf871195e75b8c2..2961d5e77e9d3e4d6481d56e788bc470a3f4e85c 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/Goon/Goon.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/Goon/Goon.cs @@ -42,12 +42,6 @@ public class Goon : EnemyEntity Vector3 dampVelocity = new(); Rigidbody.velocity = Vector3.SmoothDamp(Rigidbody.velocity, Vector3.zero, ref dampVelocity, GameConfig.MOVEMENT_SMOOTHING); } - - protected new void OnDrawGizmosSelected() - { - base.OnDrawGizmosSelected(); - stateController.VisualizeDetection(this); - } private void OnDeath() { @@ -60,4 +54,12 @@ public class Goon : EnemyEntity yield return new WaitForSeconds(2); Destroy(gameObject); } + + // Debugging functions + protected new void OnDrawGizmosSelected() + { + base.OnDrawGizmosSelected(); + stateController.VisualizeDetection(this); + stateController.VisualizePatrolRoute(this); + } } \ No newline at end of file diff --git a/Assets/_Scripts/Core/Entities/Mobs/Goon/GoonAIController.cs b/Assets/_Scripts/Core/Entities/Mobs/Goon/GoonAIController.cs index 77ff39194f8c13fa9c936b10b05a681f89f86260..217c1a498c75e31e002fba6484c52f816b2656e1 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/Goon/GoonAIController.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/Goon/GoonAIController.cs @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; @@ -14,6 +15,9 @@ public class GoonAIController [HideInInspector] public NavMeshAgent nav; protected float attackWindowSize = 0.3f; protected Coroutine attackWindowCoroutine; + protected int patrolIndex = 0; + public float patrolSpeed = 3; + public List<Transform> patrolRoute; // Constructor public void Init(Goon goon) @@ -29,6 +33,24 @@ public class GoonAIController { switch (GoonState.GetAIState(goon.stateController.State)) { + case GoonState.AI_PATROL_STATE: + Debug.Log("Going"); + if(patrolRoute.Count > 0) + { + GoToward(patrolRoute[patrolIndex]); + if(Vector3.Distance(patrolRoute[patrolIndex].position, goon.transform.position) < 0.1) + { + if(patrolIndex < patrolRoute.Count) + { + patrolIndex++; + } + else + { + patrolIndex = 0; + } + } + } + break; case GoonState.AI_DETECTED_STATE: GoToward(GameController.Instance.player.transform); break; diff --git a/Assets/_Scripts/Core/Entities/Mobs/Goon/GoonState.cs b/Assets/_Scripts/Core/Entities/Mobs/Goon/GoonState.cs index b196077014ba5dfe55afb8f87c88ecf27f501802..2aed01c3534007a2cbdc5549ae574a8c60f31a28 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/Goon/GoonState.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/Goon/GoonState.cs @@ -1,11 +1,12 @@ public class GoonState : CombatantEntityState { - public const int AI_DETECTED_STATE = 128; - public const int AI_IN_RANGE_STATE = 256; - public const int AI_IN_RANGE_CLOSE_STATE = 256; + public const int AI_PATROL_STATE = 128; + public const int AI_DETECTED_STATE = 256; + public const int AI_IN_RANGE_STATE = 512; + public const int AI_IN_RANGE_CLOSE_STATE = 1024; public static int GetAIState(int state) { - return state & (AI_DETECTED_STATE | AI_IN_RANGE_STATE | AI_IN_RANGE_CLOSE_STATE); + return state & (AI_PATROL_STATE | AI_DETECTED_STATE | AI_IN_RANGE_STATE | AI_IN_RANGE_CLOSE_STATE); } } \ No newline at end of file diff --git a/Assets/_Scripts/Core/Entities/Mobs/Goon/GoonStateController.cs b/Assets/_Scripts/Core/Entities/Mobs/Goon/GoonStateController.cs index 81da8c96e8fce24bfed08d9ae0236d4163069daa..f39a66ba2d3ad9a8c70063c0cacee21f7aa481ac 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/Goon/GoonStateController.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/Goon/GoonStateController.cs @@ -49,13 +49,18 @@ public class GoonStateController : EntityStateController } else if(Vector3.Distance(goon.Position, GameController.Instance.player.Position) < detectionDistance) { - if(GoonState.GetAIState(state) == 0) + if(GoonState.GetAIState(state) < GoonState.AI_DETECTED_STATE) { - Debug.Log("Wah"); goon.audioController.Play(Goon.AUDIO_CRY_KEY); } + goon.aiController.nav.speed = goon.Speed; aiState = GoonState.AI_DETECTED_STATE; } + else + { + goon.aiController.nav.speed = goon.aiController.patrolSpeed; + aiState = GoonState.AI_PATROL_STATE; + } // Get attackState int attackState = 0; @@ -112,7 +117,7 @@ public class GoonStateController : EntityStateController } - // Debugging purposes + // Debugging functions public void VisualizeDetection(MonoBehaviour monoBehaviour) { Gizmos.color = Color.yellow; @@ -120,4 +125,14 @@ public class GoonStateController : EntityStateController Gizmos.color = Color.red; Gizmos.DrawWireSphere(monoBehaviour.transform.position, attackDistance); } + + public void VisualizePatrolRoute(Goon goon) + { + Gizmos.color = Color.cyan; + for (int i = 0; i < goon.aiController.patrolRoute.Count - 1; i++) + { + Gizmos.DrawLine(goon.aiController.patrolRoute[i].position, goon.aiController.patrolRoute[i + 1].position); + } + Gizmos.DrawLine(goon.aiController.patrolRoute[^1].position, goon.aiController.patrolRoute[0].position); + } } diff --git a/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoon.cs b/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoon.cs index 2131868d5692ba1b085d2a9e43038cbad06372ab..72eefb0cc7b004eea18c30b482d0a3c0a4ea0362 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoon.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoon.cs @@ -71,12 +71,6 @@ public class HeadGoon : EnemyEntity Vector3 dampVelocity = new(); Rigidbody.velocity = Vector3.SmoothDamp(Rigidbody.velocity, Vector3.zero, ref dampVelocity, GameConfig.MOVEMENT_SMOOTHING); } - - protected new void OnDrawGizmosSelected() - { - base.OnDrawGizmosSelected(); - stateController.VisualizeDetection(this); - } private void OnDeath() { @@ -89,4 +83,12 @@ public class HeadGoon : EnemyEntity yield return new WaitForSeconds(2); Destroy(gameObject); } + + // Debugging functions + protected new void OnDrawGizmosSelected() + { + base.OnDrawGizmosSelected(); + stateController.VisualizeDetection(this); + stateController.VisualizePatrolRoute(this); + } } \ No newline at end of file diff --git a/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoonAIController.cs b/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoonAIController.cs index 225afb5b4247962070b3d984f5c28bfba567dcfe..0e62705c7b6c9a537ad8ff48c6aeb663e8d64888 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoonAIController.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoonAIController.cs @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; @@ -14,6 +15,9 @@ public class HeadGoonAIController protected float attackWindowSize = 0.3f; protected Coroutine attackWindowCoroutine; private HeadGoon headGoon; + protected int patrolIndex = 0; + public float patrolSpeed = 3; + public List<Transform> patrolRoute; // Constructor public void Init(HeadGoon headGoon) @@ -29,6 +33,23 @@ public class HeadGoonAIController { switch (HeadGoonState.GetAIState(headGoon.stateController.State)) { + case HeadGoonState.AI_PATROL_STATE: + if(patrolRoute.Count > 0) + { + GoToward(patrolRoute[patrolIndex]); + if(Vector3.Distance(patrolRoute[patrolIndex].position, headGoon.transform.position) < 0.1) + { + if(patrolIndex < patrolRoute.Count) + { + patrolIndex++; + } + else + { + patrolIndex = 0; + } + } + } + break; case HeadGoonState.AI_DETECTED_STATE: GoToward(GameController.Instance.player.transform); break; diff --git a/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoonState.cs b/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoonState.cs index ba0dfe123a57a8a986eb7523644bc3b030ddd950..9befe8be75999bc02b3c0a17b2ce8dcf3566a08a 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoonState.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoonState.cs @@ -1,11 +1,12 @@ public class HeadGoonState : CombatantEntityState { - public const int AI_DETECTED_STATE = 128; - public const int AI_IN_RANGE_STATE = 256; - public const int AI_IN_RANGE_CLOSE_STATE = 256; + public const int AI_PATROL_STATE = 128; + public const int AI_DETECTED_STATE = 256; + public const int AI_IN_RANGE_STATE = 512; + public const int AI_IN_RANGE_CLOSE_STATE = 1024; public static int GetAIState(int state) { - return state & (AI_DETECTED_STATE | AI_IN_RANGE_STATE | AI_IN_RANGE_CLOSE_STATE); + return state & (AI_PATROL_STATE | AI_DETECTED_STATE | AI_IN_RANGE_STATE | AI_IN_RANGE_CLOSE_STATE); } } \ No newline at end of file diff --git a/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoonStateController.cs b/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoonStateController.cs index d5c8a5896bace9548528a87d5f8250b56a564b7c..84e53ab4027dfa98109d1d16798024639cd47ddb 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoonStateController.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/HeadGoon/HeadGoonStateController.cs @@ -48,16 +48,22 @@ public class HeadGoonStateController : EntityStateController int aiState = 0; if(Vector3.Distance(headGoon.Position, GameController.Instance.player.Position) < attackDistance) { - if(HeadGoonState.GetAIState(state) == 0) - { - headGoon.audioController.Play(HeadGoon.AUDIO_CRY_KEY); - } aiState = HeadGoonState.AI_IN_RANGE_STATE; } else if(Vector3.Distance(headGoon.Position, GameController.Instance.player.Position) < detectionDistance) { + if(HeadGoonState.GetAIState(state) < HeadGoonState.AI_DETECTED_STATE) + { + headGoon.audioController.Play(HeadGoon.AUDIO_CRY_KEY); + } + headGoon.aiController.nav.speed = headGoon.Speed; aiState = HeadGoonState.AI_DETECTED_STATE; } + else + { + headGoon.aiController.nav.speed = headGoon.aiController.patrolSpeed; + aiState = HeadGoonState.AI_PATROL_STATE; + } // Get attackState int attackState = 0; @@ -114,7 +120,7 @@ public class HeadGoonStateController : EntityStateController } - // Debugging purposes + // Debugging functions public void VisualizeDetection(MonoBehaviour monoBehaviour) { Gizmos.color = Color.yellow; @@ -122,4 +128,14 @@ public class HeadGoonStateController : EntityStateController Gizmos.color = Color.red; Gizmos.DrawWireSphere(monoBehaviour.transform.position, attackDistance); } + + public void VisualizePatrolRoute(HeadGoon headGoon) + { + Gizmos.color = Color.cyan; + for (int i = 0; i < headGoon.aiController.patrolRoute.Count - 1; i++) + { + Gizmos.DrawLine(headGoon.aiController.patrolRoute[i].position, headGoon.aiController.patrolRoute[i + 1].position); + } + Gizmos.DrawLine(headGoon.aiController.patrolRoute[^1].position, headGoon.aiController.patrolRoute[0].position); + } } diff --git a/Assets/_Scripts/Core/Entities/Mobs/King/King.cs b/Assets/_Scripts/Core/Entities/Mobs/King/King.cs index f868558cde32161bb60e831f83339ac66404b651..b59d6651f448dbbe68737203e8ed0cb97a98a44c 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/King/King.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/King/King.cs @@ -119,12 +119,6 @@ public class King : BossEntity Vector3 dampVelocity = new(); Rigidbody.velocity = Vector3.SmoothDamp(Rigidbody.velocity, Vector3.zero, ref dampVelocity, GameConfig.MOVEMENT_SMOOTHING); } - - protected new void OnDrawGizmosSelected() - { - base.OnDrawGizmosSelected(); - stateController.VisualizeDetection(this); - } private void OnDeath() { @@ -138,4 +132,12 @@ public class King : BossEntity yield return new WaitForSeconds(2); Destroy(gameObject); } + + // Debugging functions + protected new void OnDrawGizmosSelected() + { + base.OnDrawGizmosSelected(); + stateController.VisualizeDetection(this); + stateController.VisualizePatrolRoute(this); + } } \ No newline at end of file diff --git a/Assets/_Scripts/Core/Entities/Mobs/King/KingAIController.cs b/Assets/_Scripts/Core/Entities/Mobs/King/KingAIController.cs index 8e5fee657c8cb29ffcaf6a1c6a12f5b708fe9670..118756e5ba0cf228f82c927603ae318775d9c12c 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/King/KingAIController.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/King/KingAIController.cs @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; @@ -14,6 +15,9 @@ public class KingAIController private King king; protected float attackWindowSize = 0.3f; protected Coroutine attackWindowCoroutine; + protected int patrolIndex = 0; + public float patrolSpeed = 3; + public List<Transform> patrolRoute; // Constructor public void Init(King king) @@ -29,6 +33,23 @@ public class KingAIController { switch (KingState.GetAIState(king.stateController.State)) { + case KingState.AI_PATROL_STATE: + if(patrolRoute.Count > 0) + { + GoToward(patrolRoute[patrolIndex]); + if(Vector3.Distance(patrolRoute[patrolIndex].position, king.transform.position) < 0.1) + { + if(patrolIndex < patrolRoute.Count) + { + patrolIndex++; + } + else + { + patrolIndex = 0; + } + } + } + break; case KingState.AI_DETECTED_STATE: GoToward(GameController.Instance.player.transform); break; diff --git a/Assets/_Scripts/Core/Entities/Mobs/King/KingState.cs b/Assets/_Scripts/Core/Entities/Mobs/King/KingState.cs index 6fdfada3e198287a4df34dfee08ee81b0cc261ba..73159ebf500f3f37a6af2f86d468a4fa0698935a 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/King/KingState.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/King/KingState.cs @@ -1,11 +1,12 @@ public class KingState : CombatantEntityState { - public const int AI_DETECTED_STATE = 128; - public const int AI_IN_RANGE_STATE = 256; - public const int AI_IN_RANGE_CLOSE_STATE = 256; + public const int AI_PATROL_STATE = 128; + public const int AI_DETECTED_STATE = 256; + public const int AI_IN_RANGE_STATE = 512; + public const int AI_IN_RANGE_CLOSE_STATE = 1024; public static int GetAIState(int state) { - return state & (AI_DETECTED_STATE | AI_IN_RANGE_STATE | AI_IN_RANGE_CLOSE_STATE); + return state & (AI_PATROL_STATE | AI_DETECTED_STATE | AI_IN_RANGE_STATE | AI_IN_RANGE_CLOSE_STATE); } } \ No newline at end of file diff --git a/Assets/_Scripts/Core/Entities/Mobs/King/KingStateController.cs b/Assets/_Scripts/Core/Entities/Mobs/King/KingStateController.cs index 2fcac0863ecc63dc46a59eecd59e34a759c9c6a7..a2815c899cbd89e6f1c2af24a215f05b512be181 100644 --- a/Assets/_Scripts/Core/Entities/Mobs/King/KingStateController.cs +++ b/Assets/_Scripts/Core/Entities/Mobs/King/KingStateController.cs @@ -56,12 +56,18 @@ public class KingStateController : EntityStateController } else if(Vector3.Distance(king.Position, GameController.Instance.player.Position) < detectionDistance) { - if(KingState.GetAIState(state) == 0) + if(KingState.GetAIState(state) < KingState.AI_DETECTED_STATE) { king.audioController.Play(King.AUDIO_CRY_KEY); } + king.aiController.nav.speed = king.Speed; aiState = KingState.AI_DETECTED_STATE; } + else + { + king.aiController.nav.speed = king.aiController.patrolSpeed; + aiState = KingState.AI_PATROL_STATE; + } // Get attackState int attackState = 0; @@ -133,7 +139,7 @@ public class KingStateController : EntityStateController } - // Debugging purposes + // Debugging functions public void VisualizeDetection(MonoBehaviour monoBehaviour) { Gizmos.color = Color.yellow; @@ -143,4 +149,14 @@ public class KingStateController : EntityStateController Gizmos.color = Color.red; Gizmos.DrawWireSphere(monoBehaviour.transform.position, attackDistance); } + + public void VisualizePatrolRoute(King king) + { + Gizmos.color = Color.cyan; + for (int i = 0; i < king.aiController.patrolRoute.Count - 1; i++) + { + Gizmos.DrawLine(king.aiController.patrolRoute[i].position, king.aiController.patrolRoute[i + 1].position); + } + Gizmos.DrawLine(king.aiController.patrolRoute[^1].position, king.aiController.patrolRoute[0].position); + } } diff --git a/Assets/_Scripts/Library/BaseClasses/EntityObject/WorldEntity.cs b/Assets/_Scripts/Library/BaseClasses/EntityObject/WorldEntity.cs index 3b8e0f08a9e303696fa603a41835937a578e0054..659fcee6b2e0f6b8820e2221a572a0447132b3f6 100644 --- a/Assets/_Scripts/Library/BaseClasses/EntityObject/WorldEntity.cs +++ b/Assets/_Scripts/Library/BaseClasses/EntityObject/WorldEntity.cs @@ -7,8 +7,8 @@ public class WorldEntity : WorldObject, IRigid // Attributes public readonly List<StatEffect> effects = new(); [HideInInspector] public CharacterModel model; - [SerializeField] protected float knockbackResistance; [SerializeField] protected float baseSpeed; + [SerializeField] protected float knockbackResistance; [SerializeField] protected float jumpForce; [SerializeField] protected LayerMask groundLayers; protected Vector3 groundDetectionSize;