public void Initialize(SaveBanner.TYPE _eType, int _iNo, string _strImage, string _strTime) { if (_strImage.Equals("") == true) { m_strImage = string.Format(CsvSave.PNG_NAME_FORMAT, _iNo); } else { m_strImage = _strImage; } m_csvSave = new CsvSave(); m_csvSave.Load(_iNo); if (_strTime.Equals("") == true && m_csvSave.m_bExistData == true) { m_strSaveTime = m_csvSave.Read("save_time"); } else if (_strTime.Equals("") == false) { m_strSaveTime = _strTime; } else { m_strSaveTime = "データがありません"; } m_lbTime.text = m_strSaveTime; m_sprImage.sprite2D = SpriteManager.Instance.Load(m_strImage); m_lbNo.text = string.Format("No.{0:D3}", _iNo); TriggerClear(); m_eStep = STEP.IDLE; m_eStepPre = STEP.MAX; if (_eType == TYPE.SAVE) { m_sprBase.color = new Color((188.0f / 255.0f), 1.0f, 0.0f); } else { m_sprBase.color = new Color(1.0f, (132.0f / 255.0f), 0.0f); } return; }
private void LoadGameData(CsvSave _save, int _iNo, ref GameData _data, bool _bLoadOnly) { _save.Load(_iNo); _readGameData(_save, ref _data); }
// Update is called once per frame void Update() { bool bInit = false; if (m_eStepPre != m_eStep) { m_eStepPre = m_eStep; bInit = true; } switch (m_eStep) { case STEP.SCREENSHOT: if (bInit) { StartCoroutine(startScreenshot()); m_bScreenshot = false; EditDirectory.MakeDirectory(CsvSave.FILE_DIRECTORY); } if (m_bScreenshot) { m_goDispRoot.SetActive(true); m_eType = SaveBanner.TYPE.SAVE; if (m_bLoadOnly) { m_btnTabSave.gameObject.SetActive(false); m_eType = SaveBanner.TYPE.LOAD; } m_closeButton = PrefabManager.Instance.MakeObject("prefab/CloseButton", m_goDispRoot).GetComponent <ButtonBase> (); m_eStep = STEP.IDLE; if (m_bLoadOnly == false) { NendAdInterstitial.Instance.Show(); } } break; case STEP.IDLE: if (m_eType == SaveBanner.TYPE.SAVE) { m_eStep = STEP.SAVE_PAGE; } else { m_eStep = STEP.LOAD_PAGE; } m_eStep = STEP.SAVE_PAGE; break; case STEP.SAVE_PAGE: if (bInit) { if (m_saveBannerRoot == null) { m_saveBannerRoot = PrefabManager.Instance.MakeScript <SaveBannerRoot> ("prefab/SaveBannerRoot", m_goDispRoot); } // ここの10は特に可変にはしてません m_saveBannerRoot.Initialize(m_eType, 10); m_saveBannerRoot.TriggerClearAll(); m_closeButton.TriggerClear(); m_btnTabSave.TriggerClear(); m_btnTabLoad.TriggerClear(); } if (m_saveBannerRoot.ButtonPushed) { m_iCheckNo = m_saveBannerRoot.Index + 1; // あんまよくないけどここで補正 m_saveBannerRoot.TriggerClearAll(); m_eStep = STEP.SAVE_CHECK; bool bSound = true; if (m_eType == SaveBanner.TYPE.LOAD) { CsvSave save = new CsvSave(); save.Load(m_iCheckNo); if (false == save.m_bExistData) { m_eStep = m_eStepPre; bSound = false; } else { m_strSaveTime = save.Read("save_time"); } } if (bSound) { SoundHolder.Instance.Call(DataManager.Instance.SOUND_NAME_CURSOR); } else { SoundHolder.Instance.Call(DataManager.Instance.SOUND_NAME_CANCEL); } } if (m_btnTabLoad.ButtonPushed) { m_eType = SaveBanner.TYPE.LOAD; m_eStep = STEP.IDLE; } if (m_btnTabSave.ButtonPushed) { m_eType = SaveBanner.TYPE.SAVE; m_eStep = STEP.IDLE; } if (m_closeButton.ButtonPushed) { m_eStep = STEP.END; } break; case STEP.SAVE_CHECK: if (bInit) { m_saveCheck = PrefabManager.Instance.MakeScript <SaveCheck> ("prefab/SaveCheck", gameObject); m_saveCheck.Initialize(m_eType, m_iCheckNo, m_strSaveTime, m_bLoadOnly); } if (m_saveCheck.IsEnd()) { m_bDecide = m_saveCheck.m_bDecide; m_eStep = STEP.IDLE; if (m_bDecide) { if (m_bLoadOnly) { m_eStep = STEP.END; } SoundHolder.Instance.Call(DataManager.Instance.SOUND_NAME_DECIDE); } else { SoundHolder.Instance.Call(DataManager.Instance.SOUND_NAME_CANCEL); } Destroy(m_saveCheck.gameObject); } break; case STEP.LOAD_PAGE: if (m_closeButton.ButtonPushed) { m_eStep = STEP.END; } break; case STEP.LOAD_CHECK: break; case STEP.END: if (bInit) { SpriteManager.Instance.Unload(TEMP_SCREENSHOT_NAME); if (m_bLoadOnly == false) { NendAdInterstitial.Instance.Show(); } m_bIsEnd = true; } break; case STEP.MAX: default: break; } }