void Start() { //Debug.Log("".IndexOf()); // 初期データのインスタンスがない場合は、データを再ロードする。 isDataReady = TextFileHelper.IsExist(Const.Path.MasterData.escapeInput) && ScenarioRepository.Count != 0; if (!isDataReady && TextFileHelper.IsExist(Const.Path.MasterData.escapeInput)) { GameController.Instance.Init(); isDataReady = true; } viewController = GameObject.FindObjectOfType <StorySceneViewController>(); scenarioManager = GameObject.FindObjectOfType <ScenarioManager>(); escapeManager = GameObject.FindObjectOfType <EscapeManager>(); viewController.Init(); scenarioManager.Init(); textHelper = new TextComponentHelper(viewController.contentText); if (isDataReady) { scenarioManager.Next(); } }
public void Init() { if (TextFileHelper.IsExist(Const.Path.MasterData.escapeInput)) { MasterDataManager.Instance.UpdateData(); Debug.Log("Loaded data from local storage."); if (TextFileHelper.IsExist(Const.Path.GameData.userItem)) { GameDataManager.Instance.UpdateData(); Debug.Log("Loaded gameData from local storage."); } else { GameDataManager.Instance.CreateInitialData(); Debug.Log("Created initial gameData."); } } else { Debug.Log("Downloading data from spreadsheet. Go to main scene after a moment."); MasterDataManager.Instance.DownloadData(); UnityEngine.SceneManagement.SceneManager.LoadScene("Start"); } }