public bool Copy(string key, ref string dest, bool allowCopyNull) { bool flag; JSONValue jsonvalue = this.Get(key, out flag); if (flag && (!jsonvalue.IsNull() || allowCopyNull)) { dest = ((!jsonvalue.IsNull()) ? jsonvalue.AsString(false) : null); } return(flag); }
public bool Copy(string key, ref int dest) { bool flag; JSONValue jsonvalue = this.Get(key, out flag); if (flag && !jsonvalue.IsNull()) { dest = (int)jsonvalue.AsFloat(false); } return(flag); }
public bool Copy(string key, ref bool dest) { bool flag; JSONValue jsonvalue = this.Get(key, out flag); if (flag && !jsonvalue.IsNull()) { dest = jsonvalue.AsBool(false); } return(flag); }
private static string RefreshMainAssets(JSONValue jval, Package package) { string text = "unknown"; try { text = "assetbundles"; JSONValue jsonvalue = jval.Get(text); if (!jsonvalue.IsNull()) { List <string> list = new List <string>(); List <JSONValue> list2 = jsonvalue.AsList(false); foreach (JSONValue jsonvalue2 in list2) { list.Add(jsonvalue2.AsString(false)); } package.MainAssets = list; } } catch (JSONTypeException ex) { return(string.Concat(new string[] { "Malformed metadata response for mainAssets '", package.Name, "' field '", text, "': ", ex.Message })); } catch (KeyNotFoundException ex2) { return(string.Concat(new string[] { "Malformed metadata response for package. '", package.Name, "' field '", text, "': ", ex2.Message })); } return(null); }