コード例 #1
0
ファイル: CG_Public.cs プロジェクト: isoundy000/shenqi
        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);
        }
コード例 #2
0
ファイル: CG_Public.cs プロジェクト: isoundy000/shenqi
        /// <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);
        }