关卡一场景上传
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Unity.Cinemachine;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
@@ -28,9 +29,15 @@ public class MusicGame : MonoBehaviour
|
||||
|
||||
public void Play()
|
||||
{
|
||||
mainCamera.transform.position = new Vector3(0, 100, -10);
|
||||
mainCamera.transform.rotation = Quaternion.Euler(new Vector3(0, 0, 0));
|
||||
mainCamera.GetComponent<CinemachineBrain>().enabled = false;
|
||||
isPlaying = true;
|
||||
judgeLine = mainCamera.transform.position + new Vector3(0, -2f, 8);
|
||||
startDsp = AudioSettings.dspTime; // 音频原点
|
||||
gameObject.GetComponent<AudioSource>().Play();
|
||||
tickNote.ForEach(x => Destroy(x));
|
||||
tickNote.Clear();
|
||||
foreach (MusicTick tick in musicData.musicTicks)
|
||||
ActivateTick(tick);
|
||||
}
|
||||
@@ -87,6 +94,9 @@ public class MusicGame : MonoBehaviour
|
||||
else
|
||||
{
|
||||
isPlaying = false;
|
||||
tickId = 0;
|
||||
noteId = 0;
|
||||
mainCamera.GetComponent<CinemachineBrain>().enabled = true;
|
||||
Debug.Log("完成所有tick");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,14 +10,14 @@ public class Note : MonoBehaviour
|
||||
public float approach = 1f;
|
||||
|
||||
[Header("运行参数")]
|
||||
[SerializeField] private float speed = 1f;
|
||||
[SerializeField] private float speed = 3f;
|
||||
private bool judged = false;
|
||||
|
||||
/* 1. 静态:最近一次空格的 dspTime */
|
||||
private double lastSpaceTime = double.NegativeInfinity;
|
||||
|
||||
private double spawnTime => beatTime - approach;
|
||||
private float spawnY = 6f;
|
||||
private float spawnY = MusicGame.Instance.judgeLine.y + 8f;
|
||||
private float judgeY => MusicGame.Instance.judgeLine.y;
|
||||
private bool canMove = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user