Fixinprocess
This commit is contained in:
1 parent
0619ada74f
commit
921c4125b7
772 files changed
+154236
-144405
No files matched your search
@@ -1,8 +1,7 @@
|
||||
using System.Linq;
|
||||
using Code.Infrastructure.Particles;
|
||||
using Code.Infrastructure.Utils;
|
||||
using Code.OfficeGame.BattleMode.Actions.Deciders;
|
||||
using Code.OfficeGame.BattleMode.HitBoxes;
|
||||
using Code.OfficeGame.BattleMode.Timeline;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.OfficeGame.BattleMode.Actions.Attacks
|
||||
@@ -10,10 +9,12 @@ namespace Code.OfficeGame.BattleMode.Actions.Attacks
|
||||
public class BattleActionPlayerAttackMMA : BattleAction
|
||||
{
|
||||
private AttackActionConfig _attackData;
|
||||
private IParticleService _particleService;
|
||||
public int EntryStateHash => Animator.StringToHash("WalkBlend");
|
||||
|
||||
public BattleActionPlayerAttackMMA(MultipleConfig<BattleActionParameters> attackData)
|
||||
public BattleActionPlayerAttackMMA(MultipleConfig<BattleActionParameters> attackData, IParticleService particleService)
|
||||
{
|
||||
_particleService = particleService;
|
||||
_attackData = (AttackActionConfig)
|
||||
attackData.Configs.SingleOrDefault(x=>x.ActionType == ActionType);
|
||||
}
|
||||
@@ -31,15 +32,13 @@ namespace Code.OfficeGame.BattleMode.Actions.Attacks
|
||||
var entityAnimator = entity.animator;
|
||||
|
||||
// TODO Root Motion не должен быть использован в нормальных анимациях
|
||||
entityAnimator.Play(EntryStateHash, 0, 0f); // Создать None State и кинуть эту штуку туда
|
||||
entityAnimator.Update(0f);
|
||||
|
||||
entityAnimator.applyRootMotion = false;
|
||||
entityAnimator.transform.localPosition = Vector3.zero;
|
||||
entityAnimator.transform.localRotation = Quaternion.identity;
|
||||
|
||||
entityAnimator.applyRootMotion = true;
|
||||
entityAnimator.Play(_attackData.StateHash, 0, 0f);
|
||||
entityAnimator.Update(0f);
|
||||
|
||||
entityAnimator.ResetAnimatorPosition();
|
||||
entityAnimator.applyRootMotion = true;
|
||||
}
|
||||
|
||||
actionData.CurrentFrame++;
|
||||
@@ -58,9 +57,7 @@ namespace Code.OfficeGame.BattleMode.Actions.Attacks
|
||||
entityAnimator.Update(0f);
|
||||
|
||||
// TODO С нормальными анимациями не нужен будет рут моушен√
|
||||
entityAnimator.applyRootMotion = false;
|
||||
entityAnimator.transform.localPosition = Vector3.zero;
|
||||
entityAnimator.transform.localRotation = Quaternion.identity;
|
||||
entityAnimator.ResetAnimatorPosition();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -78,10 +75,16 @@ namespace Code.OfficeGame.BattleMode.Actions.Attacks
|
||||
{
|
||||
var originEntityId = enemyCollider.GetComponentInParent<EntityProperties>().GetEntityId();
|
||||
|
||||
var actionData = new StuggerActionData { TotalFrames = _attackData.StuggerFrames};
|
||||
var actionData = new StuggerActionData { TotalFrames = _attackData.StuggerFrames, CurrentFrame = 0};
|
||||
var decisionResult = new AsIsBattleActionDeciderResult {ActionType = BattleActionType.Stugger};
|
||||
|
||||
BattleTimeline.ForceDecideAction(originEntityId, actionData, decisionResult);
|
||||
|
||||
_particleService.EmitOneShot(
|
||||
new ParticlePartitionIDPair(ParticlePartition.HitParticles, 0),
|
||||
15,
|
||||
enemyCollider.transform.position,
|
||||
Quaternion.identity);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user