public IEnumerator Exists(ExistCheckParams pParams) { System.IO.FileInfo fi = new FileInfo(pParams.mPath); yield return(0); pParams.mResult = fi.Exists; yield break; }
static IEnumerator Init <T>(string pPath) where T : SerializedRoot, new() { var parms = new ExistCheckParams(pPath); var existCheck = IO.Exists(parms); while (existCheck.MoveNext()) { yield return(0); } if (parms.mResult) { IO.Load <T>(pPath); while (!IO.LoaderFinished) { yield return(0); } if (IO.LoaderHasError) { IO.CreateEmpty <T>(); Debug.LogError(kLogPrefix + IO.LoaderError); } Debug.Log(kLogPrefix + "Loader Done"); yield break; } else { IO.CreateEmpty <T>(); Debug.Log(kLogPrefix + " Creating empty instance"); yield break; } }