From 755410c2853a8c88341e028fe0134b96d2f8de1b Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 10 May 2023 20:27:30 +0300 Subject: [PATCH 1/4] chore: rebake map --- Assets/Scenes/Empty/NavMesh.asset | Bin 14780 -> 14780 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Assets/Scenes/Empty/NavMesh.asset b/Assets/Scenes/Empty/NavMesh.asset index 3c9c71d02c7a476a3713ee407f8d43c0def15248..23799c724bc9f25b51af077763e1b2fb8186c5e0 100644 GIT binary patch delta 505 zcmdl}yr+1BhZu9~Yw5|}Vo$-eu{ea5mVnUAk`Veel)fwl;qR7)(2Hdtbhj*oE|!DP z(ee=5Sph<8D?(^trKjpZ`y3g-;DE#GRa%F_LPhN%{Dgxr_L@~uljW6Ai`C!BOwJoJV_QG5Z zV}mpU-8MN{`!#nEP#*&$6HsT!+AWXB$B1U_%IPZ3Ll} xjUhC*355O(rEi-;_=n9P^lEbmJ=x+b|MkTx4h|1*9bjNM;dFhm%jD^nssNjOzb^m) delta 505 zcmdl}yr+1BhZytq#Y&UC#h!v`V{r&AEdimKB_Z@{D1BK9!rv_op%=?Q=x$jET`UKo zqvavAvjT+HR)o;PN>9~+_Bk?u!2yTWtF#VRYs1JKj?@|o}jXf(Q&f5Y9-i1n^hqe&sKxb&FT<3TLVG| zYwF4XjR9L67CO})=7_M+P%wM4f|AJO4VsU*_cHJ>u!1aS*gtu$RzBEper-!>ki9Th z!`L9rARi=azvgxX>SJJJ0_t;~9H|4*cUlKx`DR@RJzEb#H|s;_Yy$`#YzU#PjUcqL wF@)wefzY3!^leiJ|F9W^UTqGcCtG~wuNE Date: Wed, 10 May 2023 20:42:08 +0300 Subject: [PATCH 2/4] feat: add move and stop moving events to bots script --- Assets/Scripts/Bot/BotMovement.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Bot/BotMovement.cs b/Assets/Scripts/Bot/BotMovement.cs index 4eab08ac..30f80f08 100644 --- a/Assets/Scripts/Bot/BotMovement.cs +++ b/Assets/Scripts/Bot/BotMovement.cs @@ -1,4 +1,5 @@ -using UnityEngine; +using Events; +using UnityEngine; using UnityEngine.AI; using Random = UnityEngine.Random; @@ -13,6 +14,10 @@ public class BotMovement : MonoBehaviour [Header("Strafe")] [SerializeField] private float _strafeSpeed = 1.0f; [SerializeField] private float _strafeDistance = 1.0f; + + [Header("Events")] + [SerializeField] private GameEvent _onMove; + [SerializeField] private GameEvent _onStopMoving; private float _strafeDirection = 1.0f; private float _currentStrafe = 0.0f; @@ -42,11 +47,13 @@ private void Start() public void Stop() { + _onStopMoving.Raise(this, null); _agent.isStopped = true; } public void Resume() { + _onMove.Raise(this, null); _agent.isStopped = false; } From 4748169e5cc2922dd489c52ed232b5153abdb65a Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 10 May 2023 20:42:37 +0300 Subject: [PATCH 3/4] chore: add sounds range and event to prefabs --- Assets/Prefabs/Heroes/Bot.prefab | 89 ++++++++++++++++++++++++++++- Assets/Prefabs/Heroes/Player.prefab | 6 +- 2 files changed, 89 insertions(+), 6 deletions(-) diff --git a/Assets/Prefabs/Heroes/Bot.prefab b/Assets/Prefabs/Heroes/Bot.prefab index fc1ceb69..77f11f00 100644 --- a/Assets/Prefabs/Heroes/Bot.prefab +++ b/Assets/Prefabs/Heroes/Bot.prefab @@ -22,6 +22,9 @@ GameObject: - component: {fileID: 5977217962883420356} - component: {fileID: -143211974280577395} - component: {fileID: 1450017669390518002} + - component: {fileID: 6604856619764781148} + - component: {fileID: 5617542302611998510} + - component: {fileID: 4631081897391786331} m_Layer: 8 m_Name: Bot m_TagString: Untagged @@ -149,9 +152,9 @@ AudioSource: Priority: 128 DopplerLevel: 1 MinDistance: 1 - MaxDistance: 500 + MaxDistance: 40 Pan2D: 0 - rolloffMode: 0 + rolloffMode: 1 BypassEffects: 0 BypassListenerEffects: 0 BypassReverbZones: 0 @@ -184,7 +187,7 @@ AudioSource: m_Curve: - serializedVersion: 3 time: 0 - value: 0 + value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 @@ -288,6 +291,8 @@ MonoBehaviour: _randomPointMinRadius: 25 _strafeSpeed: 3 _strafeDistance: 2 + _onMove: {fileID: 11400000, guid: bd6ab64eada019c409c422e42ec4c918, type: 2} + _onStopMoving: {fileID: 11400000, guid: a70a62ef516cea842a927b4d6e2fc81d, type: 2} --- !u!114 &6342258248279081278 MonoBehaviour: m_ObjectHideFlags: 0 @@ -346,6 +351,84 @@ MonoBehaviour: _canBeUsed: 0 _cooldown: 10 _weapon: {fileID: 1517286153842906975} +--- !u!114 &6604856619764781148 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 477042130070592955} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 29cb451c42b5b6541bb006ebe5520e34, type: 3} + m_Name: + m_EditorClassIdentifier: + _footstepSounds: + - {fileID: 8300000, guid: 6ab9d8a0aee0ba84391a409cf4124420, type: 3} + - {fileID: 8300000, guid: 63dfbf1ace13cbd49a003083610e96e3, type: 3} + - {fileID: 8300000, guid: 74d48642acd4ca0489f1f29e14bafc2d, type: 3} + - {fileID: 8300000, guid: 878193017d0966840b98eb49c00a13ef, type: 3} + - {fileID: 8300000, guid: fa6a281b065ad324ca8da96cb26593ac, type: 3} + _jumpSound: {fileID: 8300000, guid: e708389b7a8f64a46aa12d201c187b69, type: 3} + _landingSound: {fileID: 8300000, guid: 3d8f480d252db9449b2f978284506f8e, type: 3} + _footstepWalkDelay: 0.35 + _footstepSneakDelay: 0.52 +--- !u!114 &5617542302611998510 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 477042130070592955} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 867288c91c5643cf9bfbbf84cd8c17e3, type: 3} + m_Name: + m_EditorClassIdentifier: + _gameEvent: {fileID: 11400000, guid: bd6ab64eada019c409c422e42ec4c918, type: 2} + _response: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 6604856619764781148} + m_TargetAssemblyTypeName: Sound.FootstepsSound, Assembly-CSharp + m_MethodName: PlayFootstepsSound + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!114 &4631081897391786331 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 477042130070592955} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 867288c91c5643cf9bfbbf84cd8c17e3, type: 3} + m_Name: + m_EditorClassIdentifier: + _gameEvent: {fileID: 11400000, guid: a70a62ef516cea842a927b4d6e2fc81d, type: 2} + _response: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 6604856619764781148} + m_TargetAssemblyTypeName: Sound.FootstepsSound, Assembly-CSharp + m_MethodName: StopFootstepsSound + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!1 &6756570863302181772 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Heroes/Player.prefab b/Assets/Prefabs/Heroes/Player.prefab index 5593f72c..d5bd0764 100644 --- a/Assets/Prefabs/Heroes/Player.prefab +++ b/Assets/Prefabs/Heroes/Player.prefab @@ -419,9 +419,9 @@ AudioSource: Priority: 128 DopplerLevel: 1 MinDistance: 1 - MaxDistance: 500 + MaxDistance: 40 Pan2D: 0 - rolloffMode: 0 + rolloffMode: 1 BypassEffects: 0 BypassListenerEffects: 0 BypassReverbZones: 0 @@ -454,7 +454,7 @@ AudioSource: m_Curve: - serializedVersion: 3 time: 0 - value: 0 + value: 1 inSlope: 0 outSlope: 0 tangentMode: 0 From 3969c967cc0ce3edaccf0a9ffc3d96cb6fbe9db3 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 10 May 2023 20:44:01 +0300 Subject: [PATCH 4/4] fix: remove sound stop for bots --- Assets/Scripts/Bot/BotMovement.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Assets/Scripts/Bot/BotMovement.cs b/Assets/Scripts/Bot/BotMovement.cs index 30f80f08..895a00d4 100644 --- a/Assets/Scripts/Bot/BotMovement.cs +++ b/Assets/Scripts/Bot/BotMovement.cs @@ -47,7 +47,6 @@ private void Start() public void Stop() { - _onStopMoving.Raise(this, null); _agent.isStopped = true; }