Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }