-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainSelect.cs
57 lines (45 loc) · 1.19 KB
/
MainSelect.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using Valve.VR;
public class MainSelect : MonoBehaviour
{
public GameObject score;
ScoreBox scorebox;
private AudioSource click;
public AudioClip hit;
public AudioSource bgm;
public GameObject bgmobj;
// Start is called before the first frame update
void Start()
{
score = GameObject.Find("ScoreBox");
scorebox = score.GetComponent<ScoreBox>();
click = gameObject.AddComponent<AudioSource>();
bgmobj = GameObject.Find("BGM");
bgm = bgmobj.GetComponent<AudioSource>();
}
// Update is called once per frame
void Update()
{
}
public void OnCollisionEnter(Collision collision)
{
if (collision.gameObject)
{
SteamVR_Fade.Start(Color.black, 1f);
click.PlayOneShot(hit);
Invoke("Select", 1);
}
}
public void Select()
{
bgm.mute = false;
scorebox.getpoint = 0;
scorebox.combo = 0;
scorebox.combomax = 0;
scorebox.miss = 0;
SceneManager.LoadScene("select");
}
}