Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bot sounds and sound range #39

Merged
merged 4 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 86 additions & 3 deletions Assets/Prefabs/Heroes/Bot.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -184,7 +187,7 @@ AudioSource:
m_Curve:
- serializedVersion: 3
time: 0
value: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Assets/Prefabs/Heroes/Player.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -454,7 +454,7 @@ AudioSource:
m_Curve:
- serializedVersion: 3
time: 0
value: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
Expand Down
Binary file modified Assets/Scenes/Empty/NavMesh.asset
Binary file not shown.
8 changes: 7 additions & 1 deletion Assets/Scripts/Bot/BotMovement.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using UnityEngine;
using Events;
using UnityEngine;
using UnityEngine.AI;
using Random = UnityEngine.Random;

Expand All @@ -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;
Expand Down Expand Up @@ -47,6 +52,7 @@ public void Stop()

public void Resume()
{
_onMove.Raise(this, null);
_agent.isStopped = false;
}

Expand Down