整合包
gameplay bundle has been imported together
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class MusicPlayer : MonoBehaviour
|
||||
{
|
||||
public Image Image_Cover;
|
||||
public TMP_Text Text_Title;
|
||||
public TMP_Text Text_Time;
|
||||
public Button Button_Play;
|
||||
public Button Button_Pause;
|
||||
public Button Button_Last;
|
||||
public Button Button_Next;
|
||||
public Button Button_List;
|
||||
public Slider Slider_Progress;
|
||||
public Music_Data Music_Data => Music_Mgr.Singleton.Music_Cur;
|
||||
public static AudioSource Music_Source => Music_Mgr.Singleton.AudioSource;
|
||||
private void Start()
|
||||
{
|
||||
if (Music_Data != null)
|
||||
{
|
||||
Refresh(Music_Data);
|
||||
}
|
||||
}
|
||||
public void Refresh(Music_Data data)
|
||||
{
|
||||
Image_Cover.sprite = data.Cover;
|
||||
Text_Title.text = data.Name;
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
if (Music_Source.clip != null)
|
||||
{
|
||||
Text_Time.text = Music_Mgr.Get_Time_Cur(Music_Source) + "/" + Music_Mgr.Get_Time_Max(Music_Source.clip);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user