created victory object and level progression
also tried to create a way to launch the game from any scene, but it doesn't really work. don't use anything in the folder called "DEBUG"
This commit is contained in:
34
Assets/Prefabs/DEBUG/DEBUG_persistent_data.cs
Normal file
34
Assets/Prefabs/DEBUG/DEBUG_persistent_data.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class DEBUG_persistent_data : MonoBehaviour
|
||||
{
|
||||
|
||||
[Header("PERSISTENT DATA OBJECTS")]
|
||||
[SerializeField] GameObject stateControllerPrefab;
|
||||
[SerializeField] GameObject sceneManagerPrefab;
|
||||
[SerializeField] GameObject debugCanvasPrefab;
|
||||
|
||||
void Start() {
|
||||
// check to see if a DEBUG already exists
|
||||
if (GameObject.FindGameObjectWithTag("DEBUG") != null) {
|
||||
Destroy(this.gameObject);
|
||||
} else { // if it doesn't, then this is the only one
|
||||
this.gameObject.tag = "DEBUG";
|
||||
}
|
||||
|
||||
|
||||
// create persistent data, state controller, scene manager if they don't exist
|
||||
if (GameObject.FindGameObjectWithTag("StateController") == null) {
|
||||
Instantiate(stateControllerPrefab);
|
||||
}
|
||||
if (GameObject.FindGameObjectWithTag("SceneManager") == null) {
|
||||
Instantiate(sceneManagerPrefab);
|
||||
}
|
||||
if (GameObject.FindGameObjectWithTag("DebugCanvas") == null) {
|
||||
Instantiate(debugCanvasPrefab);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user