//Awake is always called before any Start functions void Awake() { //Check if instance already exists if (instance == null) { //if not, set instance to this instance = this; movementoptions = Movemment.allmovement; } //If instance already exists and it's not this: else if (instance != this) { //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. Destroy(gameObject); } //Sets this to not be destroyed when reloading scene DontDestroyOnLoad(gameObject); //Get a component reference to the attached BoardManager script boardScript = GetComponent <Map_script>(); //Call the InitGame function to initialize the first level }
public void Settings(Movemment trueornot) { switch (trueornot) { case Movemment.allmovement: break; case Movemment.buttons: break; case Movemment.keyboard: break; case Movemment.touch: break; case Movemment.touchandbuttons: break; } movementoptions = trueornot; if (SceneManager_Script.instance.Currentlevelinformation() == "CubePuzzler_01") { GameObject.FindGameObjectWithTag("Canvas").GetComponent <Canvas_Script>().Optionchange(); } }