拼图测试场景
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using A2W;
|
||||
using Unity.Cinemachine;
|
||||
using UnityEngine;
|
||||
@@ -15,11 +16,10 @@ public class MusicGame : SceneSingleton<MusicGame>
|
||||
public Vector3 judgeLine;
|
||||
private List<GameObject> tickNote = new List<GameObject>();
|
||||
double startDsp;
|
||||
|
||||
public int Sroce = 0;
|
||||
void Start()
|
||||
{
|
||||
mainCamera = Camera.main;
|
||||
|
||||
}
|
||||
|
||||
void Update()
|
||||
@@ -27,6 +27,11 @@ public class MusicGame : SceneSingleton<MusicGame>
|
||||
// if (Keyboard.current.qKey.wasPressedThisFrame) Play();
|
||||
}
|
||||
|
||||
public async Task openGameUI()
|
||||
{
|
||||
await UIManager.instance.ShowPanel<MusicGamePanel>();
|
||||
}
|
||||
|
||||
public void Play()
|
||||
{
|
||||
mainCamera.transform.position = new Vector3(0, 100, -10);
|
||||
@@ -93,11 +98,13 @@ public class MusicGame : SceneSingleton<MusicGame>
|
||||
// ActivateTick(musicData.musicTicks[tickId]);
|
||||
else
|
||||
{
|
||||
UIManager.instance.HidePanel<MusicGamePanel>();
|
||||
gameObject.GetComponent<AudioSource>().Stop();
|
||||
isPlaying = false;
|
||||
tickId = 0;
|
||||
noteId = 0;
|
||||
mainCamera.GetComponent<CinemachineBrain>().enabled = true;
|
||||
Debug.Log("完成所有tick");
|
||||
Debug.Log($"完成所有tick,分数{Sroce}");
|
||||
GameFlowMgr.instance.completeLevel(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ public class Note : MonoBehaviour
|
||||
Debug.Log($"音符 {Uid}击中");
|
||||
judged = true;
|
||||
lastSpaceTime = double.NegativeInfinity;
|
||||
MusicGame.instance.Sroce += 10;
|
||||
MusicGame.instance.onNoteHit(Uid);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -12,8 +12,8 @@ public class PianoInteractable : MonoBehaviour, IInteractable
|
||||
Debug.Log("OnExitInteractionRange");
|
||||
}
|
||||
|
||||
public void OnInteract()
|
||||
public async void OnInteract()
|
||||
{
|
||||
MusicGame.instance.Play();
|
||||
await MusicGame.instance.openGameUI();
|
||||
}
|
||||
}
|
||||
20
Assets/Gameplay/Scripts/Frist/SceneInit.cs
Normal file
20
Assets/Gameplay/Scripts/Frist/SceneInit.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Threading.Tasks;
|
||||
using A2W;
|
||||
using UnityEngine;
|
||||
|
||||
public class SceneInit : MonoBehaviour
|
||||
{
|
||||
MessagePanel messagePanel;
|
||||
async Task Init()
|
||||
{
|
||||
// messagePanel = await UIManager.instance.ShowPanel<MessagePanel>();
|
||||
// messagePanel.AddMessage("寻找有关于音乐的物品");
|
||||
// Debug.Log("寻找有关于音乐的物品");
|
||||
}
|
||||
async void Start()
|
||||
{
|
||||
messagePanel = await UIManager.instance.ShowPanel<MessagePanel>();
|
||||
messagePanel.AddMessage("Search for items related to music");
|
||||
Debug.Log("寻找有关于音乐的物品");
|
||||
}
|
||||
}
|
||||
2
Assets/Gameplay/Scripts/Frist/SceneInit.cs.meta
Normal file
2
Assets/Gameplay/Scripts/Frist/SceneInit.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 03f01a4a562213c419a7595dcf397006
|
||||
Reference in New Issue
Block a user