-
Notifications
You must be signed in to change notification settings - Fork 0
/
displaySong.cs
86 lines (76 loc) · 2.58 KB
/
displaySong.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class displaySong : MonoBehaviour
{
public GameObject backgroundMusic;
public AudioSource song;
public TextMeshProUGUI songName;
public bool RFTracksOnOff;
public bool isSongChanging;
void Start()
{
song = backgroundMusic.GetComponent<AudioSource>();
songName = GetComponent<TextMeshProUGUI>();
if (PlayerPrefs.GetInt("RS") == 0)
{
RFTracksOnOff = false;
}
else if (PlayerPrefs.GetInt("RS") == 1)
{
RFTracksOnOff = true;
}
}
private void Update()
{
if (isSongChanging == false)
{
if (RFTracksOnOff == true)
{
songName.text = "Now Playing: " + song.clip.name + ".mp3";
}
else
{
songName.text = "Now Playing: " + song.clip.name;
}
}
if (Input.GetKeyDown(KeyCode.C) == true)
{
StartCoroutine(changeSong());
}
}
IEnumerator changeSong()
{
isSongChanging = true;
songName.text = "djbfksjdbfjklsdbhfdjbfksjdbfjklsdbhf";
yield return new WaitForSeconds(0.1f);
songName.text = "823yur923hyr8u9j5489djerfherhertherhtrher";
yield return new WaitForSeconds(0.1f);
songName.text = "erfherhertherhtrhernjbnnghjghjygjgjhjg";
yield return new WaitForSeconds(0.1f);
songName.text = "njbnnghjghjygjgjhjgerfherhertherhtrher";
yield return new WaitForSeconds(0.1f);
songName.text = "34234t23t435b3b53b5434234t23t435b3b53b54";
yield return new WaitForSeconds(0.1f);
songName.text = "djbfksjdbfjklsdbhfdjbfksjdbfjklsdbhf";
yield return new WaitForSeconds(0.1f);
songName.text = "823yur923hyr8u9j5489djerfherhertherhtrher";
yield return new WaitForSeconds(0.1f);
songName.text = "erfherhertherhtrhernjbnnghjghjygjgjhjg";
yield return new WaitForSeconds(0.1f);
songName.text = "njbnnghjghjygjgjhjgerfherhertherhtrher";
yield return new WaitForSeconds(0.1f);
songName.text = "34234t23t435b3b53b5434234t23t435b3b53b54";
yield return new WaitForSeconds(0.1f);
if (PlayerPrefs.GetInt("RS") == 0)
{
RFTracksOnOff = false;
}
else if (PlayerPrefs.GetInt("RS") == 1)
{
RFTracksOnOff = true;
}
isSongChanging = false;
}
}