| 12345678910111213141516171819202122232425262728293031323334353637 | using LitJson;using System.Collections.Generic;namespace GFGGame{    public class JsonUtil    {        private static Dictionary<string, object> _obj = new Dictionary<string, object>();        public static string createJsonStr(params object[] args)        {            _obj.Clear();            if(args != null)            {                int count = args.Length;                for(int i = 0; i < count; i+=2)                {                    _obj.Add((string)args[i], args[i+1]);                }            }            return JsonMapper.ToJson(_obj);        }                public static Dictionary<string, object> createJsonDic(params object[] args)        {            Dictionary<string, object> dic = new Dictionary<string, object>();            if(args != null)            {                int count = args.Length;                for(int i = 0; i < count; i+=2)                {                    dic.Add((string)args[i], args[i+1]);                }            }            return dic;        }    }}
 |