狐狸技能临时版
This commit is contained in:
		| @ -8,6 +8,8 @@ end | ||||
| function LevelFoxRole:ReceiveBeginPlay() | ||||
| 	self["SpineAnimationComponent"]:SetAnimation(0, "Idle/Front", true) | ||||
|     self.last_animation = "Idle/Front" | ||||
|     self:InitMoveSpeed(300) | ||||
|     self:InitHealth(500, 500) | ||||
| end | ||||
|  | ||||
|  | ||||
| @ -32,6 +34,8 @@ function LevelFoxRole:OnMoveDirectionChanged(InDirection) | ||||
|         self["SpineAnimationComponent"]:SetAnimation(0, cur_animation, true) | ||||
|         self.last_animation = cur_animation | ||||
|     end | ||||
|  | ||||
|     self["SpineAnimationComponent"]:SetTimeScale(1.0) | ||||
| end | ||||
|  | ||||
|  | ||||
| @ -40,5 +44,32 @@ function LevelFoxRole:OnMove(location) | ||||
|     self["MovementComponent"]:MoveTo(location) | ||||
| end | ||||
|  | ||||
| function LevelFoxRole:OnUltimateSkill() | ||||
|     print("LevelFoxRole:OnUltimateSkill") | ||||
|     local sprint_distance = 600 | ||||
|     local sprint_speed_rate = 3.8 | ||||
|  | ||||
|     -- 获取角色朝向 | ||||
|     local forward_direction = self["MovementComponent"]:GetForwardDirection() | ||||
|  | ||||
|     self["MovementComponent"]:SprintTo(sprint_distance, sprint_speed_rate) | ||||
|  | ||||
|  | ||||
|     local anim_comp = self["SpineAnimationComponent"] | ||||
|     if forward_direction.X >= 0 then | ||||
|         anim_comp:SetAnimation(0, "Ultimate/Right/UltimateStage1", false) | ||||
|     else | ||||
|         anim_comp:SetAnimation(0, "Ultimate/Left/UltimateStage1", false) | ||||
|     end | ||||
|     local anim_entry = anim_comp:GetCurrent(0) | ||||
|  | ||||
|     local anim_total_time = anim_entry:GetAnimationEnd() | ||||
|     local sprint_time = sprint_distance / (self:GetSpeed() * sprint_speed_rate) | ||||
|  | ||||
|     anim_comp:SetTimeScale(anim_total_time / sprint_time) | ||||
|  | ||||
|     print("hahhh", anim_total_time, sprint_time) | ||||
| end | ||||
|  | ||||
|  | ||||
| return Class(nil, nil, LevelFoxRole) | ||||
		Reference in New Issue
	
	Block a user