Beispiel #1
0
        public bool SetConfig(string json)
        {
            if (string.IsNullOrEmpty(json))
            {
                return(false);
            }

            try
            {
                var o = JObject.Parse(json);
                if (o == null)
                {
                    return(false);
                }
                config = o;
                Update();
                editor.ShowSection();
                return(true);
            }
            catch { }
            return(false);
        }
Beispiel #2
0
        public bool LoadJsonFromFile(string content)
        {
            if (string.IsNullOrEmpty(content))
            {
                return(false);
            }

            try
            {
                var o = JObject.Parse(content);
                if (o == null)
                {
                    return(false);
                }
                config = o;
                Update();
                editor.ShowSection();
                MarkOriginalFile();
                return(true);
            }
            catch { }
            return(false);
        }
Beispiel #3
0
 public void Prepare()
 {
     editor = GetComponent <ConfigerComponet.Editor>();
     editor.ShowSection();
     Update();
 }