public AppManifestStore(Func <string, bool> overwriteFunc, Func <string> loadFunc) { this.buildManifest = new BuildManifest <BuildManifestType>(); // load or renew runtimeManifest. RuntimeManifestType runtimeManifestObj; { var runtimeManifestObjStr = loadFunc(); // loaded str is null or empty. need crate new file. if (string.IsNullOrEmpty(runtimeManifestObjStr)) { runtimeManifestObj = new RuntimeManifestType(); var jsonStr = JsonUtility.ToJson(runtimeManifestObj); overwriteFunc(jsonStr); } else { runtimeManifestObj = JsonUtility.FromJson <RuntimeManifestType>(runtimeManifestObjStr); } } this.runtimeManifest = new RuntimeManifest <RuntimeManifestType>(runtimeManifestObj); this.overwriteFunc = overwriteFunc; this.loadFunc = loadFunc; }
public AppManifestStore(Func <string, bool> overwriteFunc, Func <string> loadFunc) { this.buildManifest = new BuildManifest <BuildManifestType>(); this.loadFunc = loadFunc; this.overwriteFunc = overwriteFunc; // load or renew runtimeManifest. ReloadFromStorage(); }