// Use this for initialization void Start() { CantDoAnythingWeAreLoading = false; if (Game.current != null) { Game.current = null; } Controls = PlayerController.CreateWithDefaultBindings(); SaveAndLoad.LoadExists(); buttonPressTime = rechargeTime; SelectionTimer = SelectionBuffer; if (SaveAndLoad.SaveExists || SaveAndLoad.Save2Exists) { LoadAvailable = true; } else { LoadAvailable = false; } /*switch (SaveAndLoad.SaveExists) * { * case true: * LoadAvailable = true; * break; * case false: * LoadAvailable = false; * break; * default: * LoadAvailable = false; * break; * }*/ switch (LoadAvailable) { case false: SelectionNumber = 1; foreach (GameObject items in MenuSelections) { items.SetActive(false); } foreach (Text itemText in MenuSelectionText) { itemText.color = DefaultColour; } MenuSelectionText[0].color = DeactivatedColour; ClickableTitleScreenButtons[0].SetActive(false); MenuSelections[SelectionNumber].SetActive(true); MenuSelectionText[SelectionNumber].color = HighlightedColour; break; case true: SelectionNumber = 0; break; } }
// Use this for initialization void Start() { Controls = PlayerController.CreateWithDefaultBindings(); //see if save file exists SaveAndLoad.LoadExists(); if (SaveAndLoad.SaveExists == true) { FileFound[0] = true; Debug.Log("save 1 found"); } else if (SaveAndLoad.SaveExists == false) { FileFound[0] = false; Debug.Log("no save 1"); } if (SaveAndLoad.Save2Exists == true) { FileFound[1] = true; Debug.Log("save 2 found"); } else if (SaveAndLoad.Save2Exists == false) { FileFound[1] = false; Debug.Log("no save 2"); } selectedButtonDone = false; //if (FileFound) //{ // //} NowLoading.SetActive(false); //set menu based on if save file exists Selections = 1; if (FileFound[0]) { //LoadExistsObj[0].SetActive(true); NoLoadObj[0].SetActive(false); SetupDisplayForLoadData(0); } else if (!FileFound[0]) { //LoadExistsObj[0].SetActive(false); NoLoadObj[0].SetActive(true); } if (FileFound[1]) { //LoadExistsObj[1].SetActive(true); NoLoadObj[1].SetActive(false); SetupDisplayForLoadData(1); } else if (!FileFound[1]) { //LoadExistsObj[1].SetActive(false); NoLoadObj[1].SetActive(true); } selectionTimer = 0; }