Example #1
0
        public static GameObject LoadObject(string Path)
        {
            GameObject obj    = null;
            bool       on_off = Resources.Load <GameObject>(Path) is GameObject;

            if (on_off)
            {
                Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["JZDXCG"], Path));
                obj = Resources.Load <GameObject>(Path);
            }
            else
            {
                Debug.LogError(CG_Windows.Format((string)CG_Config.LABEL["JZDXSB"], obj));
            }
            return(obj);
        }
Example #2
0
        /// <summary>
        /// 加载Json表
        /// </summary>
        public static JsonData LoadJson(string jsonName)
        {
            bool     on_off = Resources.Load("Json/" + jsonName).ToString() is string;
            string   file   = null;
            JsonData json   = null;

            if (jsonName == "Label")
            {
                file = Resources.Load("Json/" + jsonName).ToString(); json = JsonMapper.ToObject(file); CG_Config.label = json;
            }
            if (on_off)
            {
                file = Resources.Load("Json/" + jsonName).ToString();
                json = JsonMapper.ToObject(file);
                Debug.Log(CG_Windows.Format((string)CG_Config.LABEL["JZJSONCG"], jsonName));
                return(json);
            }
            else
            {
                Debug.LogError(CG_Windows.Format((string)CG_Config.LABEL["JZJSONSB"], file));
            }
            return(json);
        }