Ejemplo n.º 1
0
        static int _m_LogYellow_xlua_st_(RealStatePtr L)
        {
            try {
                {
#if UNITY_EDITOR
                    string text = LuaAPI.lua_tostring(L, 1);

                    GameDebug.LogYellow(text);
#else
                    LuaAPI.lua_tostring_noret(L, 1);
#endif

                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据InstanceInfo,查询其需要的场景资源
        /// 成功返回true
        /// </summary>
        /// <param name="instanceInfo"></param>
        /// <param name="asset_path"></param>
        /// <returns></returns>
        protected static bool TryGetSceneResByInstanceInfo(DBInstance.InstanceInfo instanceInfo, out string asset_path)
        {
            asset_path = string.Empty;
            if (instanceInfo.mStages == null || instanceInfo.mStages.Count <= 0)
            {
                return(false);
            }

            var stage_id = instanceInfo.mStages[0];
            var map_ids  = DBManager.Instance.QuerySqliteField <string>(GlobalConfig.DBFile, "data_stage_map", "id", stage_id, "map");

            if (map_ids == null || map_ids.Count <= 0)
            {
                return(false);
            }

            var map_id = Convert.ToUInt32(map_ids[0]);

            var db = DBManager.GetInstance().GetDB <DBMap>();

            if (db == null)
            {
                return(false);
            }

            var map_info = db.GetMapInfo(map_id);

            if (map_info == null)
            {
                return(false);
            }


            asset_path = map_info.SceneResPath;
            GameDebug.LogYellow(asset_path);

            return(true);
        }