Skip to content

Commit

Permalink
quest sfx
Browse files Browse the repository at this point in the history
  • Loading branch information
mifu67 committed May 10, 2024
1 parent aedc32f commit b46d0cb
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions Assets/Scenes/Home.unity
Original file line number Diff line number Diff line change
Expand Up @@ -5424,6 +5424,7 @@ MonoBehaviour:
notes: {fileID: 557372190}
newQuestIconMain: {fileID: 1352304502}
newQuestIconSecond: {fileID: 1868334768}
chime: {fileID: 8300000, guid: fa43564aa1da24f1cb09f1283fb133ff, type: 3}
discoveredEvidence:
- {fileID: 2067715716476407502}
- {fileID: 1933810516}
Expand Down
8 changes: 6 additions & 2 deletions Assets/Scripts/NotebookScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ public class NotebookScript : MonoBehaviour
[SerializeField] private GameObject notes;
[SerializeField] private GameObject newQuestIconMain; // next to notebook button
[SerializeField] private GameObject newQuestIconSecond; // next to quest button
private AudioSource audioSource;

[SerializeField]
private AudioClip chime;
private List<GameObject> tabs = new List<GameObject>();
public static NotebookScript Instance;
private bool notebookOpen = false;
Expand All @@ -40,6 +43,7 @@ private void Awake()
return;
}
Instance = this;
audioSource = gameObject.AddComponent<AudioSource>();
DontDestroyOnLoad(gameObject);

emptyEvidence.SetActive(true);
Expand Down Expand Up @@ -151,7 +155,6 @@ public void AddEvidence(int index)
}
}

// change to iEnumerator later
public IEnumerator AddQuest(int index)
{
if (emptyQuest.activeSelf) {
Expand All @@ -160,13 +163,14 @@ public IEnumerator AddQuest(int index)
newQuestIconMain.SetActive(true);
newQuestIconSecond.SetActive(true);
questList[index].SetActive(true);
audioSource.PlayOneShot(chime);
yield return new WaitForSeconds(3);
newQuestIconMain.SetActive(false);
}

public void CompleteQuest(int index)
{
Debug.Log("Quest completed."); // placeholder
Debug.Log("Quest completed.");
questList[index].GetComponent<Quest>().MarkQuestCompleted();
}
}
Binary file added Assets/chime.mp3
Binary file not shown.
23 changes: 23 additions & 0 deletions Assets/chime.mp3.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b46d0cb

Please sign in to comment.