Elin Modding Docs Doc
Loading...
Searching...
No Matches
UISong.cs
1using System;
2using UnityEngine;
3using UnityEngine.UI;
4
5// Token: 0x020005EB RID: 1515
6public class UISong : EMono
7{
8 // Token: 0x060029B7 RID: 10679 RVA: 0x000EB51A File Offset: 0x000E971A
9 private void Awake()
10 {
11 UISong.Instance = this;
12 }
13
14 // Token: 0x060029B8 RID: 10680 RVA: 0x000EB522 File Offset: 0x000E9722
15 public void SetSong(SoundSource _source, BGMData _bgm, BGMData.Part _part)
16 {
17 this.source = _source;
18 this.part = _part;
19 this.bgm = _bgm;
20 }
21
22 // Token: 0x060029B9 RID: 10681 RVA: 0x000EB53C File Offset: 0x000E973C
23 private void Update()
24 {
25 if (this.source.source == null)
26 {
27 this.Kill();
28 return;
29 }
30 AudioSource audioSource = this.source.source;
31 this.ratio = Mathf.Clamp((audioSource.time - this.part.start) / (this.part.duration + this.bgm.song.fadeIn), 0f, 1f);
32 if (EMono.game == null || !EMono.core.IsGameStarted || this.source == null || !this.source.isPlaying || this.ratio >= 0.99f || (this.ratio <= 0f && !(EMono.pc.ai is AI_PlayMusic)))
33 {
34 this.timer += Core.delta;
35 if (this.timer > 0.3f)
36 {
37 this.Kill();
38 }
39 return;
40 }
41 this.timer = 0f;
42 RectTransform rectTransform = this.bar.rectTransform;
43 rectTransform.sizeDelta = new Vector2(this.gauge.originalWidth * this.ratio, rectTransform.sizeDelta.y);
44 }
45
46 // Token: 0x060029BA RID: 10682 RVA: 0x000EB671 File Offset: 0x000E9871
47 public void Kill()
48 {
49 UnityEngine.Object.DestroyImmediate(base.gameObject);
50 }
51
52 // Token: 0x04001791 RID: 6033
53 public static UISong Instance;
54
55 // Token: 0x04001792 RID: 6034
56 public Gauge gauge;
57
58 // Token: 0x04001793 RID: 6035
59 public Image bar;
60
61 // Token: 0x04001794 RID: 6036
62 public SoundSource source;
63
64 // Token: 0x04001795 RID: 6037
65 public BGMData.Part part;
66
67 // Token: 0x04001796 RID: 6038
68 public BGMData bgm;
69
70 // Token: 0x04001797 RID: 6039
71 public float ratio;
72
73 // Token: 0x04001798 RID: 6040
74 private float timer;
75}
Definition EMono.cs:6