-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSparringScript.cs
More file actions
36 lines (29 loc) · 1.05 KB
/
SparringScript.cs
File metadata and controls
36 lines (29 loc) · 1.05 KB
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
// Unless denoted by a commented out link, TK wrote literally everything here
// This script sets a playerpref improvised bool to indicate
// if a sparring match is happening to true,
// then loads the Match Scene
public class SparringScript : MonoBehaviour
{
public SavePrefs prefs;
public SceneChanger sceneChanger;
// public float waitSeconds = 1.0f;
public int sceneNum = 5;
// Start is called before the first frame update
void Start()
{
Scene s = SceneManager.GetActiveScene();
if (s.buildIndex == 6 || s.name == "6Sparring")
{
// Debug.Log("You are in Scene 6!");
bool doSparring;
prefs.SavePrefBool("SparringMatch", true);
doSparring = prefs.GetPrefBool("SparringMatch");
Debug.Log("Sparring Status set to: " + doSparring);
sceneChanger.GoSceneNumber(sceneNum);
}
}
}