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 diff --git a/Assets/Scenes/Empty/NavMesh.asset b/Assets/Scenes/Empty/NavMesh.asset index 3c9c71d0..23799c72 100644 Binary files a/Assets/Scenes/Empty/NavMesh.asset and b/Assets/Scenes/Empty/NavMesh.asset differ diff --git a/Assets/Scripts/Bot/BotMovement.cs b/Assets/Scripts/Bot/BotMovement.cs index 4eab08ac..895a00d4 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; @@ -47,6 +52,7 @@ public void Stop() public void Resume() { + _onMove.Raise(this, null); _agent.isStopped = false; }