local TablePool = require('Infrast/TablePool') local Capacity = 1024 local LuaConst = LuaConst local FP = FP local Command = TablePool( function(cmd) if cmd then cmd.Frame = 0 cmd.SkillIndex = 0 cmd.MoveType = 1 cmd.MoveDir:Reset() cmd.RotateDir:Reset() cmd.SpecialCommand = LuaConst.SpecialCommandType.None cmd.UseJoyStick = 0 cmd.SkillJoystickPosX:Reset() cmd.SkillJoystickPosZ:Reset() cmd.DecisionID = nil cmd.TargetPos = nil cmd.DontHandle = false --联机AI会用到,有时需要跳过LogicUpdateManager的private.HandleCommand避免空command覆盖WantRotateDir导致走走停停的发抖 cmd.AISkillAimPos = nil -- AI释放技能时,存在特殊的点 else cmd = { --第几帧 Frame = 0, --技能按键 SkillIndex = 0, -- 移动 ,摇杆的幅度 ;0 半摇杆 1 全摇杆 MoveType = 1, --移动方向 MoveDir = FP.newV2(0,0), --朝向 RotateDir = FP.newV2(0,0), --特殊指令 SpecialCommand = LuaConst.SpecialCommandType.None, --是否使用双摇杆 ,默认不使用 UseJoyStick = 0, SkillJoystickPosX = FP.newV1(0), SkillJoystickPosZ = FP.newV1(0), --特殊决策 DecisionID = nil, --目标位置 TargetPos = nil, DontHandle = false, --联机AI会用到,有时需要跳过LogicUpdateManager的private.HandleCommand避免空command覆盖WantRotateDir导致走走停停的发抖 AISkillAimPos = nil, -- AI释放技能时,存在特殊的点 } end return cmd end, function(cmd) if cmd.TargetPos then FP.releaseV2(cmd.TargetPos) cmd.TargetPos = nil cmd.AISkillAimPos = nil end end, Capacity ) return Command