Skip to content

Commit

Permalink
Added sound effect events to various scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
supraditya committed May 22, 2024
1 parent fe8e97a commit e460dc8
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 65 deletions.
1 change: 1 addition & 0 deletions Assets/CLAWS/1-Task List/Scripts/TaskInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public void FinishTask()
EventBus.Publish<SubtaskFinishedEvent>(new SubtaskFinishedEvent(Subtask));
}

EventBus.Publish<PlayAudio>(new PlayAudio("Task_Complete"));
GameObject.Find("Controller").GetComponent<WebsocketDataHandler>().SendTasklistData();
GameObject.Find("Prefab_FullTaskListScreen").GetComponent<TaskListBackend>().SetCurrentTask<bool>(true);
}
Expand Down
5 changes: 4 additions & 1 deletion Assets/CLAWS/2-Geosampling/Screenshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ public void TakePhoto()
photoCaptureObject.StartPhotoModeAsync(cameraParameters, delegate (PhotoCapture.PhotoCaptureResult result)
{
// Take a picture
photoCaptureObject.TakePhotoAsync(PhotoToMemory);
photoCaptureObject.TakePhotoAsync(PhotoToMemory);

// Play the 'picture clicked' sound effect
EventBus.Publish<PlayAudio>(new PlayAudio("Take_Picture"));
});
});
}
Expand Down
100 changes: 62 additions & 38 deletions Assets/CLAWS/2-Notifications/AudioTest.unity
Original file line number Diff line number Diff line change
Expand Up @@ -2843,50 +2843,17 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1762725227}
m_CullTransparentMesh: 1
--- !u!1 &1802144267
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1802144269}
- component: {fileID: 1802144268}
m_Layer: 0
m_Name: AudioPlayer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1802144268
--- !u!114 &1802144268 stripped
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_CorrespondingSourceObject: {fileID: 539548217081463509, guid: 8f65b772a4878d14092d6a70b4f185cd, type: 3}
m_PrefabInstance: {fileID: 6701568426184231689}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1802144267}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 75719bfe70bd7dd40a87d68799b6ff61, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1802144269
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1802144267}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.017477602, y: 0.18654826, z: 0.017999113}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1817991969
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -3266,6 +3233,63 @@ MonoBehaviour:
m_hasFontAssetChanged: 0
m_renderer: {fileID: 2038571462}
m_maskType: 0
--- !u!1001 &6701568426184231689
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1968564204419176918, guid: 8f65b772a4878d14092d6a70b4f185cd, type: 3}
propertyPath: m_LocalPosition.x
value: 0.017477602
objectReference: {fileID: 0}
- target: {fileID: 1968564204419176918, guid: 8f65b772a4878d14092d6a70b4f185cd, type: 3}
propertyPath: m_LocalPosition.y
value: 0.18654826
objectReference: {fileID: 0}
- target: {fileID: 1968564204419176918, guid: 8f65b772a4878d14092d6a70b4f185cd, type: 3}
propertyPath: m_LocalPosition.z
value: 0.017999113
objectReference: {fileID: 0}
- target: {fileID: 1968564204419176918, guid: 8f65b772a4878d14092d6a70b4f185cd, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1968564204419176918, guid: 8f65b772a4878d14092d6a70b4f185cd, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1968564204419176918, guid: 8f65b772a4878d14092d6a70b4f185cd, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1968564204419176918, guid: 8f65b772a4878d14092d6a70b4f185cd, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1968564204419176918, guid: 8f65b772a4878d14092d6a70b4f185cd, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1968564204419176918, guid: 8f65b772a4878d14092d6a70b4f185cd, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1968564204419176918, guid: 8f65b772a4878d14092d6a70b4f185cd, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8905509877096231261, guid: 8f65b772a4878d14092d6a70b4f185cd, type: 3}
propertyPath: m_Name
value: AudioPlayer
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8f65b772a4878d14092d6a70b4f185cd, type: 3}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
Expand All @@ -3278,5 +3302,5 @@ SceneRoots:
- {fileID: 835664603}
- {fileID: 1504546655}
- {fileID: 596220968}
- {fileID: 1802144269}
- {fileID: 6701568426184231689}
- {fileID: 1224266566}
3 changes: 2 additions & 1 deletion Assets/CLAWS/2-navigation/Scripts/NavScreenHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ public void InitializePathfind(string letter)
if (hasLocation)
{
EventBus.Publish(new ScreenChangedEvent(Screens.Navigation_Confirmation));
EventBus.Publish(new StartPathfinding(loc));
EventBus.Publish(new StartPathfinding(loc));
EventBus.Publish<PlayAudio>(new PlayAudio("Nav_Begin"));
destinationVector = GPSUtils.GPSCoordsToAppPosition(loc);

hasLocation = false;
Expand Down
6 changes: 4 additions & 2 deletions Assets/CLAWS/2-navigation/TestPathfinding/Pathfinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ public void destroyCurrentBreadCrumbs()
for (int i = empty.transform.childCount - 1; i >= 0; i--)
{
// Destroy the child object
Destroy(empty.transform.GetChild(i).gameObject);
Destroy(empty.transform.GetChild(i).gameObject);
EventBus.Publish<PlayAudio>(new PlayAudio("Breadcrumb_Collision"));
}
AstronautInstance.User.BreadCrumbData.AllCrumbs.Clear();
indexToBreadCrumb.Clear();
Expand Down Expand Up @@ -255,7 +256,8 @@ private void OnBreadCollision(BreadCrumbCollisionEvent e)
if (entry.Key <= e.index)
{
keysToRemove.Add(entry.Key);
Destroy(entry.Value);
Destroy(entry.Value);
EventBus.Publish<PlayAudio>(new PlayAudio("Breadcrumb_Collision"));
}
}

Expand Down
Binary file not shown.
23 changes: 0 additions & 23 deletions Assets/Resources/Notification Audio Files/recorded_audio.wav.meta

This file was deleted.

1 change: 1 addition & 0 deletions Assets/SingleGeosampleScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ public void waitingForXRF(XRFScanEvent e)

// Show Readings
XRFScanned = true;
EventBus.Publish<PlayAudio>(new PlayAudio("XRF_Scan"));
WaitingXRF.SetActive(false);
XRFReadings.SetActive(true);

Expand Down

0 comments on commit e460dc8

Please sign in to comment.