void RestartGame() {
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
void PauseGame () {
Time.timeScale = 0;
// ShowPauseMenu();
using UnityEngine; | |
public class TopDownMovement : MonoBehaviour { | |
public float walkSpeed = 5f; | |
public Boundary boundary; // optional rectangle boundary | |
float maxSpeed = 10f; | |
float curSpeed; |
using System.Collections; | |
// using System.Collections.Generic; | |
using UnityEngine; | |
public class GetGoop : MonoBehaviour { | |
Coroutine mining; | |
void OnTriggerEnter (Collider coll) { |
using UnityEngine; | |
public class GlobalState { | |
// bool paused = false; | |
public static int goop = 80; | |
public static int waveNumber = 1; | |
public static bool paused = false; | |
public static void AddGoop (int amount) { | |
goop += amount; |
/* GameStatus.cs */ | |
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.SceneManagement; | |
public class GameStatus : MonoBehaviour { | |
// There are 3 major ways to persist this data between scene changes. | |
// 1) Save the info into something persist (PlayerPrefs, a save file) | |
// - This preserves data even between game executions, not just scene changes |
using UnityEngine; | |
public class TopDownMovement : MonoBehaviour { | |
public float walkSpeed = 5f; | |
public Boundary boundary; // optional rectangle boundary | |
float maxSpeed = 10f; | |
float curSpeed; |
var hashIndex = window.location.href.indexOf('#'); // 31 | |
var stringBeforeHash = window.location.href.slice(0, hashIndex); | |
console.info('new href', stringBeforeHash); | |
window.location.href = stringBeforeHash; |