KeyInput = KeyInput or BaseClass() function KeyInput:__init() self.isCtrl = false self.isShift = false self.enable = nil if RuntimePlatform then if Application.platform == RuntimePlatform.Android then self.enable = false elseif Application.platform == RuntimePlatform.IPhonePlayer then self.enable = false end end local game_start = function() if self.enable == nil then self.enable = true end end GlobalEventSystem:Bind(EventName.GAME_START,game_start) end function KeyInput:Update() self:key_release() self:key_press() self:mouse_press() self:scroll_update() end function KeyInput:IsCtrlPress() return self.isCtrl end function KeyInput:IsShiftPress() return self.isShift end function KeyInput:scroll_update() if not self.enable or not MainCamera or not MainCamera.Instance then return end --当前是竞技场,就不让拉伸摄像机了 local scene_mgr = SceneManager.Instance if scene_mgr and scene_mgr:IsPkRankFightScene() and not scene_mgr:IsPkRankFightScene(scene_mgr:GetLastSceneId()) then return end if Input.GetAxis("Mouse ScrollWheel") < 0 then local new_size = MainCamera.Instance.camera_curr_size - 1 if new_size < 10 then new_size = 10 end MainCamera.Instance:SetBaseCameraSize(new_size) elseif Input.GetAxis("Mouse ScrollWheel") > 0 then local new_size = MainCamera.Instance.camera_curr_size + 1 if new_size > 45 then new_size = 45 end MainCamera.Instance:SetBaseCameraSize(new_size) end end function KeyInput:mouse_press() if not self.enable then return end end function KeyInput:key_release() if Input.GetKeyUp(KeyCode.Escape) and (CheatModel and CheatModel.Instance and not CheatModel:getInstance().is_open_cheat_view) then local exit_func = function() local function ok() Application.Quit() end Alert.show("是否退出游戏?",Alert.Type.Two,ok) end if ClientConfig.sdk_server then PlatformMgr:getInstance():ExitGame( exit_func ) else exit_func() end GlobalEventSystem:Fire(LoginStateEvent.REQUEST_EXIT_GAME) end if not self.enable then return end if CheatModel and CheatModel.Instance and CheatModel:getInstance().is_open_cheat_view then--打开秘籍界面就忽略快捷键了 if Input.GetKeyUp(KeyCode.Escape) then--快捷键关掉秘籍 GlobalEventSystem:Fire(EventName.OPEN_CHEAT_INPUT_VIEW) elseif Input.GetKeyUp(KeyCode.Return) or Input.GetKeyUp(KeyCode.KeypadEnter) then--回车快捷输入秘籍 CheatModel.Instance:Fire(CheatModel.CLICK_BTN_OK) end return end if Input.GetKeyUp(KeyCode.LeftControl) then self.isCtrl = false LuaProfiler.SwitchState() elseif Input.GetKeyUp(KeyCode.T) then GlobalEventSystem:Fire(TaskEvent.ANS_FINISHED_TASK_LIST,10200) -- OperateManager.Instance:StopMove() -- Scene.Instance.main_role:PlayAction("transfer") -- MainCamera.Instance:SetCameraSize(10,true) elseif Input.GetKeyUp(KeyCode.Y) then -- GlobalEventSystem:Fire(EscortConst.OPEN_ESCORT_VIEW, true) -- local args = {} -- args[1] = "1" -- args[2] = "4" -- args[3] = "0" -- IntrusionModel:getInstance():Fire(IntrusionModel.CHUANWEN,args) -- local curr_scene_id = SceneManager.Instance:GetSceneId() -- print("Test ",curr_scene_id) -- local scene_id = SceneManager.Instance:GetSceneId() -- 获取当前场景id -- local scene_info = SceneManager.Instance:GetSceneInfo(Scene_id) -- print(scene_info.SceneMap.window_minimap_width , scene_info.SceneMap.scene_width) -- -- print("Click TTTTTTT") -- -- MainCamera.Instance:SetCameraSize(40,true) -- local temp = MapModel:getInstance():GetNPCTargetInfoList() -- for k,v in pairs(temp) do -- print(v.x,v.y) -- local npc_config = ConfigItemMgr.Instance:GetNpcItem(v.id) -- for k3,v3 in pairs(npc_config) do -- print(k3,v3) -- end -- for k2,v2 in pairs(v) do -- print(k2,v2) -- end -- end -- BaseDungeonModel:getInstance():Fire(BaseDungeonModel.OPEN_DUNGEON_LOVE_SKILL_VIEW,true) --GlobalEventSystem:Fire(EventName.HIDE_ALL_UI,false) elseif Input.GetKeyUp(KeyCode.U) then -- EscortModel:getInstance():GoEscortNpc(3) -- EscortModel:getInstance():FlyToNpc() -- EscortModel:getInstance():Fire(EscortConst.OPEN_STAGE_ESCORT_RESULT_VIEW, true) -- DunManyModel.Instance:Fire(DunManyModel.OPEN_PASSWORD_VIEW) -- DunManyModel.Instance:Fire(DunManyModel.OPEN_SET_PASSWORD_VIEW) local function ok( ... ) if self.money_type == 1 then OpenFun.Open(450,1) else OpenFun.Open(420,1) end end local ask_str = string.format("您的%s不足,是否前往%s?", desc, str) Alert.show(ask_str,Alert.Type.Two ,ok,nil,"确定","取消") -- EscortModel:getInstance():Fire(EscortConst.OPEN_ESCORT_RESULT_VIEW, true, {result = 1,object_id = 1001}) -- self.try_collect_left_num = 6--采集物未创建的话,每隔一段时间尝试一下,6次就够了 -- local try_to_collect = nil--必须这么写 -- try_to_collect = function ( ) -- local monster = Scene.Instance:FindNearestMonster(EscortConst.ESCORT_COLLECT_ID, false, true) -- if monster then -- local main_role = Scene.Instance.main_role -- if main_role then -- if self.task_collect_start_real_pos == nil then -- self.task_collect_start_real_pos = co.TableXY(main_role:GetRealPos()) -- else -- self.task_collect_start_real_pos.x = main_role.real_pos.x -- self.task_collect_start_real_pos.y = main_role.real_pos.y -- end -- if self.task_collect_end_real_pos == nil then -- self.task_collect_end_real_pos = co.TableXY(monster:GetRealPos()) -- else -- self.task_collect_end_real_pos.x = monster.real_pos.x -- self.task_collect_end_real_pos.y = monster.real_pos.y -- end -- main_role:SetDirection(self.task_collect_start_real_pos, self.task_collect_end_real_pos, false, true) -- end -- EventSystem.Fire(GlobalEventSystem,EventName.OPEN_COLLECT_VIEW, monster.id, monster:GetVo().type_id, monster:GetVo().pick_time) -- else -- self.try_collect_left_num = self.try_collect_left_num - 1 -- --此时采集物可能还未创建,所以延迟一段时间再尝试 -- if not self.delay_collect_id and self.try_collect_left_num >= 0 then -- self.delay_collect_id = GlobalTimerQuest:AddPeriodQuest(try_to_collect, 0.5, 1) -- end -- end -- end -- try_to_collect() elseif Input.GetKeyUp(KeyCode.LeftShift) then self.isShift = false elseif Input.GetKeyUp(KeyCode.Z) then --秘籍输入 if Input.GetKey(KeyCode.LeftControl) then GlobalEventSystem:Fire(EventName.OPEN_CHEAT_CLIENT_VIEW) --客户端秘籍 else GlobalEventSystem:Fire(EventName.OPEN_CHEAT_INPUT_VIEW) end elseif Input.GetKeyUp(KeyCode.J) then -- OpenFun.Open(153,2,2) -- ShopModel:GetInstance():Fire(ShopModel.JUMP_TO_SHOP_ITEM, 10404) -- GlobalEventSystem:Fire(EventName.OPEN_SHOP_VIEW, 1,3,10317) --StepPackModule:getInstance():Start() elseif Input.GetKeyUp(KeyCode.L) then -- 4294967312 -- local data = EquipCollectModel.Instance:GetEquipCollectTipData(2) -- EquipCollectModel.Instance:Fire(EquipCollectConst.OPEN_EC_MAIN_VIEW, true) -- local data = { -- id = 1, -- sub_id = 1, -- goods_id = 24101021, -- } -- EquipCollectModel.Instance:SetEquipCollectNeedShowTipData(data) -- EquipCollectModel.Instance:Fire(EquipCollectConst.SHOW_EQUIP_COLLECT_TIP, data) -- EventSystem.Fire(GlobalEventSystem,EventName.OPEN_INSTRUCTION_VIEW, 60000) --StepPackModule:getInstance():SetPauseState(false) -- special_tip_data = { -- type = SpecialTipType.Timer1, -- sepeical_str = "社团跑马即将开始,%s开始", -- need_flash = false, -- show_time = 34, -- } -- CommonController.Instance:Fire(EventName.OPEN_SPECIALTIPVIEW, special_tip_data) -- GlobalEventSystem:Fire(EventName.OPEN_SHOP_VIEW, 1,2,24002091, true) local data = { role_vo_1 = role_vo, --我方 role_vo_2 = role_vo, --敌方 type = 2, --UI类型 is_break = 2, desc = string.format("进入了%s", scene_info.name or "场景"), --描述 max_num = 3, --同时显示最大数量 } if SceneManager:getInstance():IsShowDynamicInfoScene() then GlobalEventSystem:Fire(EventName.SHOW_DYNAMIC_INFO_TIP, data) end elseif Input.GetKeyUp(KeyCode.K) then local fdata = { [1] = { type_id = 270002, goods_num = 1 }, [2] = { type_id = 270002, goods_num = 1 }, [3] = { type_id = 270002, goods_num = 1 }, [4] = { type_id = 270002, goods_num = 1 }, [5] = { type_id = 270002, goods_num = 1 }, [6] = { type_id = 270002, goods_num = 1 }, [7] = { type_id = 270002, goods_num = 1 }, [8] = { type_id = 270002, goods_num = 1 }, [9] = { type_id = 270002, goods_num = 1 }, [10] = { type_id = 270002, goods_num = 1 }, [11] = { type_id = 270002, goods_num = 1 }, } local data = { [1] = { goods_type_id = 270002, num = 1 }, [2] = { goods_type_id = 270002, num = 1 }, [3] = { goods_type_id = 270002, num = 1 }, [4] = { goods_type_id = 270002, num = 1 }, [5] = { goods_type_id = 270002, num = 1 }, [6] = { goods_type_id = 270002, num = 1 }, [7] = { goods_type_id = 270002, num = 1 }, [8] = { goods_type_id = 270002, num = 1 }, [9] = { goods_type_id = 270002, num = 1 }, [10] = { goods_type_id = 270002, num = 1 }, [11] = { goods_type_id = 270002, num = 1 }, } MainUIModel:getInstance():PlayGoodsFlyList(fdata) MainUIModel:getInstance():AddFloatInfo(data) -- local data = { -- room_id = 1, -- occupy_city = -- { -- [1] = -- { -- city_id = 5, -- }, -- -- [2] = -- -- { -- -- city_id = 4, -- -- }, -- -- [3] = -- -- { -- -- city_id = 3, -- -- }, -- -- [4] = -- -- { -- -- city_id = 1, -- -- }, -- -- [5] = -- -- { -- -- city_id = 2, -- -- }, -- } -- } -- CSGWarModel:GetInstance():SetCSGWarResultInfo(data) -- CSGWarModel:GetInstance():Fire(CSGWarConst.OPEN_CSGWAR_RESULT_VIEW) -- CSGWarModel:GetInstance():Fire(CSGWarConst.OPEN_CSGWAR_SUPPORT_VIEW) -- CSGWarModel:GetInstance():Fire(CSGWarConst.OPEN_CSGWAR_RECORD_VIEW) -- local function callback( ... ) -- GlobalEventSystem:Fire(GuildTVConst.OPEN_GUILDTV_MAIN_VIEW) -- end -- special_tip_data = { -- type = SpecialTipType.Timer1, -- sepeical_str = "社团跑马即将开始,%s 后开始", -- need_flash = false, -- show_time = 34, -- end_time_callback = callback -- } -- CommonController.Instance:Fire(EventName.OPEN_SPECIALTIPVIEW, special_tip_data) -- OpenFun.Open(500,0) elseif Input.GetKeyUp(KeyCode.W) then self.key_w_down = false self:UpdateKeyMove() elseif Input.GetKeyUp(KeyCode.S) then self.key_s_down = false self:UpdateKeyMove() elseif Input.GetKeyUp(KeyCode.A) then self.key_a_down = false self:UpdateKeyMove() elseif Input.GetKeyUp(KeyCode.D) then self.key_d_down = false self:UpdateKeyMove() elseif Input.GetKeyUp(KeyCode.H) then -- GlobalEventSystem:Fire(EventName.OPEN_SHOP_VIEW, 2) -- endless_result_view = EndlessResultView.New() -- endless_result_view:Open(self.cache_result_info) -- local vo = { -- killer = { -- role_id = 1, -- name = 1, -- sex = 1, -- career = 1, -- turn = 1, -- 转生次数 -- vip_type = 1, -- vip类型(普通 or 至尊特权) -- vip_flag = 1, -- vip等级 -- level = 1, --玩家等级 -- fighting = 1, -- 战斗力 -- picture = 1, -- 玩家上传的头像地址 -- picture_ver = 1, -- 玩家上传的头像版本号(每次上传一个头像,自动加1 -- profile_photo_id = 1, -- 本地头像图片id -- dress_id = 1, --头像装扮id -- sup_vip_type = 1, --是否是永久贵族 0|否 1|体验 2|永久 -- }, -- deader = { -- role_id = 1, -- name = 1, -- sex = 1, -- career = 1, -- turn = 1, -- 转生次数 -- vip_type = 1, -- vip类型(普通 or 至尊特权) -- vip_flag = 1, -- vip等级 -- level = 1, --玩家等级 -- fighting = 1, -- 战斗力 -- picture = 1, -- 玩家上传的头像地址 -- picture_ver = 1, -- 玩家上传的头像版本号(每次上传一个头像,自动加1 -- profile_photo_id = 1, -- 本地头像图片id -- dress_id = 1, --头像装扮id -- sup_vip_type = 1, --是否是永久贵族 0|否 1|体验 2|永久 -- } -- } -- local data = { -- role_vo_1 = vo.killer, --我方 -- role_vo_2 = vo.deader, --敌方 -- type = 2, --UI类型 -- desc = "", -- is_break = 2, -- max_num = 2, --同时显示最大数量 -- need_cut_str = true, -- } -- if SceneManager:getInstance():IsShowDynamicInfoScene() then -- GlobalEventSystem:Fire(EventName.SHOW_DYNAMIC_INFO_TIP, data) -- end -- EndlessModel:getInstance():SetEndlessShutDownInfo(vo) -- EndlessModel:getInstance():Fire(EndlessConst.OPEN_ENDLESS_RANK_VIEW) -- local time = TimeUtil:getServerTime( ) -- local id = math.random(100000,999999) -- local name_len = math.random(1,6) -- local text_len = math.random(1,20) -- local name_str = "玩家名字六字" -- local text_str = "一二三四五六七八九十一二三四五六七八九十" -- local data = { -- name = string.sub(name_str, name_len), -- id = id, -- time = time, -- } -- data.content = string.sub(text_str, text_len) -- GuildTVModel:GetInstance():AddGuildTVBarrageMessage(data) -- GuildTVModel:GetInstance():Fire(GuildTVConst.OPEN_GUILDTV_READY_VIEW) -- MarketModel:getInstance():SetHasGuildGoods(true) -- TreasureHouseModel:getInstance():Fire(TreasureHouseConst.OPEN_TREASURE_HOUSE_VIEW) EscortModel:getInstance():Fire(EscortConst.REQUEST_SCMD_EVENT, 50014) GlobalEventSystem:Fire(EventName.USE_FLY_SHOE, 1006, 7825 ,15190 , call_back, true, true) -- TreasureHouseModel:getInstance():Fire(TreasureHouseConst.OPEN_TREASURE_HOUSE_REWARD_VIEW) -- local data = GuildTVModel:GetInstance():GetGuildTVRunningInfo() -- GuildTVModel:GetInstance():SetGuildTVRunningInfo(data) -- OpenFun.Open(600,2) elseif Input.GetKeyUp(KeyCode.R) then LuaMemManager:getInstance():checkToReleaseMem(true, true) --热更代码 if self.HU == nil then self.HU = _G.originalRequire "luahotupdate" self.HU.Init("hotupdatelist", {"G:\\fantacy_develop\\code\\u3d\\Lua"}) end print("zensyue:YangziTest [HotUpdate Lua] self.HU: ",self.HU) self.HU.Update() Message.show("刷新成功") elseif Input.GetKeyUp(KeyCode.P) then if not self.is_hide then GlobalEventSystem:Fire(EventName.DO_MODULE_DEBUG_FUNC, "mapview", "hiderootall") self.is_hide = true else GlobalEventSystem:Fire(EventName.DO_MODULE_DEBUG_FUNC, "mapview", "showrootall") self.is_hide = false end -- local cfg, scmd = {subtype = ChatModel.CHANNEL_SYSTEM} ,{} -- if not self.index_index then -- self.index_index = 1 -- else -- self.index_index = self.index_index + 1 -- end -- GlobalEventSystem:Fire(EventName.SHOW_CHUANWEN, "测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试"..self.index_index , cfg, scmd) -- GlobalEventSystem:Fire(EventName.OPEN_PREVIEW_OBJ_VIEW) elseif Input.GetKeyUp(KeyCode.Q) then Message.show("我就想实时") -- GlobalEventSystem:Fire(GuildTVConst.OPEN_GUILDTV_MAIN_VIEW) -- GlobalEventSystem:Fire(EventName.OPEN_ARENA_VIEW) -- GlobalEventSystem:Fire(FuliConst.OPEN_FULI_MAIN_VIEW) -- GuildTVModel.Instance:Fire(GuildTVConst.OPEN_GUILDTV_READY_VIEW) -- FuliModel:getInstance().fuli_ai_info.duration_time = 0 -- FuliModel:getInstance():Fire(FuliConst.START_HAND_ACTION) elseif Input.GetKeyUp(KeyCode.E) then -- self.tv_index = self.tv_index or 0 -- self.tv_index = self.tv_index + 1 -- local data = { -- name = "玩家"..self.tv_index, -- vip = self.tv_index % 8, -- time = TimeUtil:getServerTime() -- } -- GuildTVModel.Instance:AddGuildTVOneRecord(data) -- local data = {} -- for i=1,3 do -- data[i] = { -- rid = i, -- trust = self.tv_index * i *100 -- } -- end -- GuildTVModel.Instance:SetGuildTVHotInfo(data) -- Time.timeScale =20 -- StarSpiritModel:getInstance():Fire(StarSpiritModel.OPEN_FORMAT_VIEW) local random_list = {1,4} local end_list = {} local len = #random_list local random_ratio = 3 local random_index = nil local temp_random = nil for i=1,random_ratio*len do temp_random = math.random(1,len) temp_random = temp_random == random_index and random_index + 1 or temp_random random_index = temp_random > len and 1 or temp_random end_list[i] = random_list[random_index] end print("HWR:KeyInput [start:418] end_list:", end_list) PrintTable(end_list) print("HWR:KeyInput [end]") elseif Input.GetKeyUp(KeyCode.F1) then LuaMemManager:getInstance():checkToReleaseMem(true, true) elseif Input.GetKeyUp(KeyCode.F2) then LuaMemManager:getInstance():ForceReload() elseif Input.GetKeyUp(KeyCode.F3) then --GlobalEventSystem:Fire(EventName.OPEN_SKY_WAR_JOIN_VIEW) elseif Input.GetKeyUp(KeyCode.M) then elseif Input.GetKeyUp(KeyCode.F4) then EquipModel:getInstance():Fire(EquipModel.OPEN_ACQUIRE_VIEW, EquipModel:getInstance():GetEquipInfo(), 101000) print("-----is_auto_mf-------:", AutoFightManager:getInstance():GetAutoFightState()) print("-----GetFollowAttackId-------:", TeamModel:GetInstance():GetFollowAttackId()) print("-----game_running-------:", AutoFightManager:getInstance().game_running) print("-----IsPlaying-------:", StoryModel:getInstance():IsPlaying()) print("-----IsSceneStart-------:", SceneManager:getInstance():IsSceneStart()) print("-----IsGameConnected-------:", UserMsgAdapter:getInstance():IsGameConnected()) print("-----user_manul_moving-------:", Scene.Instance.user_manul_moving) print("-----can_auto_find_target-------:", Scene.Instance.can_auto_find_target) print("-----IsSafeScene-------:", SceneManager.Instance:IsSafeScene()) print("-----isInRigidity-------:", SkillManager.Instance:isInRigidity()) print("-----hp-------:", RoleManager.Instance.mainRoleInfo.hp, RoleManager.Instance.mainRoleInfo.ghost_mode, Scene.Instance.main_role:IsDead()) print("-----isInRigidity-------:", SkillManager.Instance:isInRigidity()) local real_pos_x, real_pos_y = Scene.Instance.main_role:GetRealPos() print("-----IsSafePos-------:", SceneManager:getInstance():IsSafePos(real_pos_x, real_pos_y)) print("-----auto_find_way-------:", AutoFightManager:getInstance().auto_find_way) local cache_pos = AutoFightManager:getInstance().auto_fight_cache_pos print("------挂机位置------------:", cache_pos.x, cache_pos.y) local angle, pos = BaseDungeonModel:getInstance():FindNearestCanTriggerPosInfo() if pos and pos.x then print("-----FindNearestCanTriggerPosInfo-------:", pos.x, pos.y) end for k, vo in pairs(SceneManager.Instance.role_vo_list) do print("+++++++++++++role_vo_list-------:", vo.name) end for k, vo in pairs(SceneManager.Instance.monster_vo_list) do print("+++++++++++++monster_vo_list-------:", vo.name) end for k, vo in pairs(Scene.Instance.monster_list) do print("+++++++++++++monster_list-------:", vo.name) end elseif Input.GetKeyUp(KeyCode.F5) then --StarFightModel:getInstance():Fire(StarFightModel.OPEN_STAR_FIGHT_VIEW) -- AutoFightManager:getInstance().not_auto_fight_for_test = not AutoFightManager:getInstance().not_auto_fight_for_test elseif Input.GetKeyUp(KeyCode.F6) then local view_path = "root" local go = GameObject.Find(view_path) if go then go.transform:Find("Canvas").gameObject:SetActive(true) end -- UIToolTipMgr:getInstance():ShowGetWayTipsView(100001, nil, nil) -- GlobalEventSystem:Fire(TaskEventType.SHOW_TASK_GUILD_ARROW, true) -- GlobalEventSystem:Fire(EventName.MAIN_UI_LAYER_VISIBLE, false) -- local pos = co.TableXY(Scene.Instance.main_role:GetRealPos()) -- print("-----------玩家此时的像素位置===:", pos.x, pos.y) -- local equip_info = EquipModel:getInstance():GetEquipInfo() -- equip_info = DeepCopy(equip_info) -- if Config.Equipconfig[101004] then -- local new_sit_grid=Config.Equipconfig[101004].pos -- if equip_info[new_sit_grid] then -- table.remove(equip_info, new_sit_grid) -- end -- end -- EquipModel:getInstance():Fire(EquipModel.FLY_EQUIP, equip_info, 101004) -- Message:show(GlobalErrorCode[102]) -- local goods_list = {} -- for i = 1, 10 do -- local obj = {} -- obj.style = 0 -- obj.typeId = 105001 -- obj.count = 2 -- table.insert(goods_list, obj) -- end -- GlobalEventSystem:Fire(EventName.REWARD_FLY, goods_list, {x = 0, y = -133}, 60, 0.1, {x = (ScreenWidth / 2 - 130 - 18), y = -(ScreenHeight / 2 - 370 - 30)}, 0.7) elseif Input.GetKeyUp(KeyCode.F7) then --StepPackModule:getInstance():SetPauseState(false) local view_path = "root" local go = GameObject.Find(view_path) if go then go.transform:Find("Canvas").gameObject:SetActive(false) end elseif Input.GetKeyUp(KeyCode.F8) then --local transform = Scene.Instance:GetMainRole().transform --MainCamera.Instance:AddScreenObj(transform) -- if NewMainRoleController.Instance.test_pattern then -- local data = CookieWrapper.Instance:GetCookie(CookieLevelType.Account, CookieKey.TEST_DETECT_PLAYER_ATTR) -- local str_list = {} -- local conbine_str = function(attr_list) -- local str = "" -- if attr_list then -- for k,v in pairs(attr_list) do -- str = str.."["..v.name.."-"..v.attr_val.."] " -- end -- end -- return str -- end -- if data and #data > 0 then -- local str = "" -- local title = "start_time,role_id,role_name,read_time,role_lv,attr_list&" -- str = str..title -- local file_name = "" -- for k,v in pairs(data) do -- str = str..v.start_time..","..v.role_id..","..v.role_name..","..v.read_time..","..v.role_lv..","..conbine_str(v.attr_list).."&" -- file_name = v.role_id..v.role_name -- end -- OutPutValue(file_name, str) -- Message.show("生成属性列表完成") -- end -- end elseif Input.GetKeyUp(KeyCode.F9) then --local transform = Scene.Instance:GetMainRole().transform --MainCamera.Instance:RemoveScreenObj(transform) PrintResList() elseif Input.GetKeyUp(KeyCode.F10) then print("tanar: KeyInput [332] =========== ") SceneObjHeight.Camera = 10 MainCamera.Instance:SetUpdateCameraEnabled(true) elseif Input.GetKeyUp(KeyCode.F11) then CameraDistanceWithMainRole = 16 MainCamera.Instance:SetUpdateCameraEnabled(true) elseif Input.GetKeyUp(KeyCode.F12) then SceneCameraRotate = 25 MainCamera.Instance:SetUpdateCameraEnabled(true) end end function KeyInput:key_press() if not self.enable then return end if CheatModel:getInstance().is_open_cheat_view then return end -- local camPos = MainCamera.Instance:GetCameraPos() -- local cam_change = false if Input.GetKey(KeyCode.LeftControl) then self.isCtrl = true elseif Input.GetKey(KeyCode.LeftShift) then self.isShift = true elseif (Input.GetKey(KeyCode.X)) then elseif (Input.GetKey(KeyCode.Y)) then elseif (Input.GetKey(KeyCode.Return) or Input.GetKey(KeyCode.KeypadEnter)) then GlobalEventSystem:Fire(EventName.RETURN_KEY_PRESS) elseif SceneManager and SceneManager.Instance and SceneManager:getInstance():IsSceneStart() then if Input.GetKey(KeyCode.W) then self.key_w_down = true self:UpdateKeyMove() elseif Input.GetKey(KeyCode.S) then self.key_s_down = true self:UpdateKeyMove() elseif Input.GetKey(KeyCode.A) then self.key_a_down = true self:UpdateKeyMove() elseif Input.GetKey(KeyCode.D) then self.key_d_down = true self:UpdateKeyMove() end if Input.GetKeyDown(KeyCode.Space) then --GlobalEventSystem:Fire(EventName.HIDE_HORSE) GlobalEventSystem:Fire(SceneEventType.MAIN_ROLE_JUMP) end end end function KeyInput:UpdateKeyMove() --在竞技联赛不让移动 if SceneManager.Instance:IsPkRankFightScene() then return end --如果本机钓鱼标识 标志正在钓鱼限制键盘输入控制移动 if Scene and Scene.Instance and Scene.Instance:GetMainRole():IsFishingState() then return end local x, y = 0, 0 if self.key_a_down and not self.key_d_down then x = -1 elseif not self.key_a_down and self.key_d_down then x = 1 end if self.key_w_down and not self.key_s_down then y = 1 elseif not self.key_w_down and self.key_s_down then y = -1 end if UIJoyStick then if self.lock then return end Scene.Instance.user_manul_moving = true Scene.Instance.user_manul_time = Status.NowTime GlobalEventSystem:Fire(EventName.CHANGE_TEMP_BTN) if x == 0 and y == 0 then Scene.Instance.user_manul_moving = false GlobalEventSystem:Fire(UIJoyStick.EVENT_TOUCH_END) else GlobalEventSystem:Fire(UIJoyStick.EVENT_DRAGGING, co.Vector2(x,y)) end end end function KeyInput:EnableInput(bool) self.enable = bool end function KeyInput:key_back() end function KeyInput:__delete() end