Skip to content
Snippets Groups Projects
Commit 123e6b97 authored by Tony Pohto's avatar Tony Pohto
Browse files

korjattu alun kaksinkertainen lautasefekti

parent 99f9df07
No related branches found
No related tags found
No related merge requests found
No preview for this file type
fileFormatVersion: 2
guid: 9bd37f1480c9b8442ad13c250f07dd78
guid: 2ef6f1f589013334ea654912ce166e26
AudioImporter:
externalObjects: {}
serializedVersion: 6
......
......@@ -308,7 +308,7 @@ PrefabInstance:
type: 3}
propertyPath: musics.Array.data[1]
value:
objectReference: {fileID: 8300000, guid: 9bd37f1480c9b8442ad13c250f07dd78, type: 3}
objectReference: {fileID: 8300000, guid: 2ef6f1f589013334ea654912ce166e26, type: 3}
- target: {fileID: 203678261489018089, guid: 530bea3a047bd31458b647c456257c63,
type: 3}
propertyPath: musics.Array.data[2]
......
......@@ -28,7 +28,7 @@ public class AudioSystem : MonoBehaviour, IAction
public void React(EventType type) {
if (type == EventType.GameStarts)
{
GameStartsClip();
StartCoroutine("GameStartsClip");
}
if (type == EventType.CitySmall)
{
......@@ -70,10 +70,13 @@ public class AudioSystem : MonoBehaviour, IAction
}
public void GameStartsClip()
public IEnumerator GameStartsClip()
{
StartCoroutine("FadeOutIn", new Timing(2,1));
StartCoroutine("PlayEffect", 6);
yield return new WaitForSeconds(2);
ac.clip = musics[1];
StartCoroutine("FadeIn", 0);
}
public void CitySmallClip()
{
......@@ -149,7 +152,7 @@ public class AudioSystem : MonoBehaviour, IAction
AudioSource v = gameObject.AddComponent<AudioSource>();
v.clip = musics[clip];
v.Play();
yield return new WaitForSeconds(v.clip.length + 1);
yield return new WaitForSeconds(v.clip.length);
Destroy(v);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment