拼图测试场景
This commit is contained in:
55
Assets/Gameplay/Scripts/UI/MusicGamePanel.cs
Normal file
55
Assets/Gameplay/Scripts/UI/MusicGamePanel.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using A2W;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class MusicGamePanel : UIPanel
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
public TMP_Text scoreText;
|
||||
public TMP_Text tipText;
|
||||
public TMP_Text tipText2;
|
||||
public Button startButton;
|
||||
|
||||
public override UniTask Hide()
|
||||
{
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
tipText.gameObject.SetActive(true);
|
||||
startButton.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public override UniTask Show()
|
||||
{
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
// startButton.onClick.AddListener(() =>
|
||||
// {
|
||||
// tipText.gameObject.SetActive(false);
|
||||
// startButton.gameObject.SetActive(false);
|
||||
// });
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
bool isStart = false;
|
||||
void Update()
|
||||
{
|
||||
scoreText.text = MusicGame.instance.Sroce.ToString();
|
||||
if (Keyboard.current.spaceKey.wasPressedThisFrame && !isStart)
|
||||
{
|
||||
isStart = true;
|
||||
tipText.gameObject.SetActive(false);
|
||||
tipText2.gameObject.SetActive(false);
|
||||
MusicGame.instance.Play();
|
||||
startButton.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user