local Base = require("Battle/Logic/AI/Decision/Decision_Base") local Decision_SetRotation = class("Decision_SetRotation", Base) --[[ 初始化 --]] function Decision_SetRotation:initialize(entity) --类型 self.Type = LuaConst.DecisionType.SetRotation --瞬时 self.IsOnce = true end --[[ 输出指令 --]] function Decision_SetRotation:SetCommand(entity, decisionData, command) command.DecisionID = decisionData.ID return command end --[[ 执行 --]] function Decision_SetRotation:Handle(entity, decisionData, stateType, animName) local rad = FP.newV1(decisionData.IntParam1):Div(180):Mul(FP.Const.PI):Mul(-1) local dir = FP.newV2(-FP.Math.Sin(rad) ,FP.Math.Cos(rad)) SystemManager.SetEntityRotateDir(entity, dir) return LuaConst.StateType.None,nil end return Decision_SetRotation