Skip to content

Commit

Permalink
songs
Browse files Browse the repository at this point in the history
  • Loading branch information
TSKsmiley committed Apr 23, 2021
1 parent e1d4de3 commit 8335e09
Show file tree
Hide file tree
Showing 20 changed files with 158 additions and 78 deletions.
1 change: 1 addition & 0 deletions .idea/.idea.RedDead2D/.idea/contentModel.xml

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

1 change: 1 addition & 0 deletions .idea/.idea.RedDead2D/.idea/indexLayout.xml

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

8 changes: 0 additions & 8 deletions Assets/Assets/Sprites/Trees/New Trees/Materials.meta

This file was deleted.

3 changes: 3 additions & 0 deletions Assets/Audio/Music/WorldMusic01.wav
Git LFS file not shown
22 changes: 22 additions & 0 deletions Assets/Audio/Music/WorldMusic01.wav.meta

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

3 changes: 3 additions & 0 deletions Assets/Audio/Music/WorldMusic02.wav
Git LFS file not shown
22 changes: 22 additions & 0 deletions Assets/Audio/Music/WorldMusic02.wav.meta

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

3 changes: 3 additions & 0 deletions Assets/Audio/Music/WorldMusic03.wav
Git LFS file not shown
22 changes: 22 additions & 0 deletions Assets/Audio/Music/WorldMusic03.wav.meta

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

25 changes: 25 additions & 0 deletions Assets/MusicPlayer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MusicPlayer : MonoBehaviour
{
[SerializeField] private string[] clips;
private int clipIndex;

void Start()
{
StartCoroutine(IPlaySound());
}

IEnumerator IPlaySound()
{
yield return new WaitForSeconds(Random.Range(40f, 60f));

clipIndex = Random.Range(0, clips.Length);
AudioManager.instance.Play(clips[clipIndex]);

yield return new WaitForSeconds(AudioManager.instance.GetSound(clips[clipIndex]).clip.length);
StartCoroutine(IPlaySound());
}
}
11 changes: 11 additions & 0 deletions Assets/MusicPlayer.cs.meta

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

64 changes: 44 additions & 20 deletions Assets/Scenes/Game World.unity
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ GameObject:
m_Component:
- component: {fileID: 7859229}
- component: {fileID: 7859228}
- component: {fileID: 7859230}
m_Layer: 0
m_Name: AudioManager
m_TagString: Untagged
Expand Down Expand Up @@ -405,8 +406,8 @@ MonoBehaviour:
spatialBlend: 0
source: {fileID: 0}
loop: 1
- name: Music
clip: {fileID: 8300000, guid: ddf347cd81e76df4888ad164d1f5d930, type: 3}
- name: -----
clip: {fileID: 0}
volume: 0.16
pitch: 1
spatialBlend: 0
Expand All @@ -422,7 +423,7 @@ MonoBehaviour:
- name: greeting1b
clip: {fileID: 8300000, guid: 324930ef952ced44f8baba9d5601b72f, type: 3}
volume: 0.6
pitch: 1
pitch: 0.1
spatialBlend: 0
source: {fileID: 0}
loop: 0
Expand All @@ -440,16 +441,23 @@ MonoBehaviour:
spatialBlend: 0
source: {fileID: 0}
loop: 0
- name: walk
clip: {fileID: 8300000, guid: 6fd071f799faa024c99fec59c2781c76, type: 3}
volume: 0.45
- name: song1
clip: {fileID: 8300000, guid: d2d225b9b9dbc814da8ed31337a2229b, type: 3}
volume: 0.3
pitch: 1
spatialBlend: 0
source: {fileID: 0}
loop: 1
- name: bearDie
clip: {fileID: 8300000, guid: 099746e886774584298178f8ae20a19c, type: 3}
volume: 0.45
loop: 0
- name: song2
clip: {fileID: 8300000, guid: 225e8daadfb867d409d7414c0ac367b2, type: 3}
volume: 0.3
pitch: 1
spatialBlend: 0
source: {fileID: 0}
loop: 0
- name: song3
clip: {fileID: 8300000, guid: 45c6866c6e3d9e446ba9e8d0269eb995, type: 3}
volume: 0.3
pitch: 1
spatialBlend: 0
source: {fileID: 0}
Expand All @@ -468,6 +476,22 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7859230
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7859227}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: df7e9a77834e9264aa77eee84d0432ed, type: 3}
m_Name:
m_EditorClassIdentifier:
clips:
- song1
- song2
- song3
--- !u!1001 &11035620
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -3188,7 +3212,7 @@ GameObject:
m_Component:
- component: {fileID: 120438634}
m_Layer: 0
m_Name: '----- Trees --------'
m_Name: ----- Trees --------
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -116235,7 +116259,7 @@ GameObject:
m_Component:
- component: {fileID: 221588026}
m_Layer: 0
m_Name: '----- Rooms -----'
m_Name: ----- Rooms -----
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -117357,7 +117381,7 @@ GameObject:
m_Component:
- component: {fileID: 270767629}
m_Layer: 0
m_Name: '----- Rocks ------'
m_Name: ----- Rocks ------
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -118776,7 +118800,7 @@ GameObject:
m_Component:
- component: {fileID: 352118942}
m_Layer: 0
m_Name: '----WORLD THINGS----'
m_Name: ----WORLD THINGS----
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -254781,7 +254805,7 @@ GameObject:
m_Component:
- component: {fileID: 879038058}
m_Layer: 0
m_Name: '----- Trees --------'
m_Name: ----- Trees --------
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -256043,7 +256067,7 @@ GameObject:
m_Component:
- component: {fileID: 984956568}
m_Layer: 0
m_Name: '----- Buildings -----'
m_Name: ----- Buildings -----
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -583172,7 +583196,7 @@ GameObject:
m_Component:
- component: {fileID: 1360240052}
m_Layer: 0
m_Name: '----- Folliage ------'
m_Name: ----- Folliage ------
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -802210,7 +802234,7 @@ GameObject:
m_Component:
- component: {fileID: 1905429541}
m_Layer: 0
m_Name: '----- Folliage ------'
m_Name: ----- Folliage ------
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -802404,7 +802428,7 @@ GameObject:
m_Component:
- component: {fileID: 1909584739}
m_Layer: 0
m_Name: '----- Rocks ------'
m_Name: ----- Rocks ------
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -802943,7 +802967,7 @@ GameObject:
m_Component:
- component: {fileID: 1935850536}
m_Layer: 0
m_Name: '----- Buildings -----'
m_Name: ----- Buildings -----
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down
8 changes: 0 additions & 8 deletions Assets/Scriptable Objects/Quests/05Quest.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Scriptable Objects/Quests/06Quest.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Scriptable Objects/Quests/07Quest.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Scriptable Objects/Quests/08Quest.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Scriptable Objects/Quests/09Quest.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Scriptable Objects/Quests/10Quest.meta

This file was deleted.

2 changes: 0 additions & 2 deletions Assets/Scripts/PlayerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ void Awake()

private void Start()
{
AudioManager.instance.Play("Music");

// CUSTOM EVENTS
Controller.instance.itemSelectEvent += OnItemSelect;

Expand Down
1 change: 1 addition & 0 deletions Assets/tentSleep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class tentSleep : MonoBehaviour

public void Sleep()
{
AudioManager.instance.Play("sleep");
sleepDark.SetTrigger("Start");
StartCoroutine(SleepEnd());
}
Expand Down

0 comments on commit 8335e09

Please sign in to comment.