public void ClickBtn() { if (ButtonType == BtnType.Replay) { ErrorText.text = ""; GeneralControlKeys.Instance.bCanRestartOrMenu = true; GameObject.FindGameObjectWithTag("GameController").GetComponent <RestartLevel>().DoRestart(); } else if (ButtonType == BtnType.Menu) { if (bIsTagEmpty()) { ErrorText.text = Invalid1; return; } else if (!bCheckTagEntry()) { ErrorText.text = Invalid2; return; } SaveComponent.SaveData(TagInput.text); GameSettings.Instance.PreviousTag = TagInput.text; Application.LoadLevel("Main"); } else if (ButtonType == BtnType.Next) { if (bIsTagEmpty()) { ErrorText.text = Invalid1; return; } else if (!bCheckTagEntry()) { ErrorText.text = Invalid2; return; } SaveComponent.SaveData(TagInput.text); GameSettings.Instance.PreviousTag = TagInput.text; GameSettings.Instance.LevelInt = (GameSettings.Instance.LevelInt + 1); Application.LoadLevel("GamePlaHol"); } }
//save script public void SaveAndExit() { Debug.Log("SaveAndExit called"); //save script . save with tag (TagInputField.text) if (bCheckTagEntry()) { SaveDataComponent.SaveData(TagInputField.text); Application.LoadLevel(sSceneToLoad); } /*else * TagErrorField.text = sErrorMsg;*/ }