TimelineImprovements
This commit is contained in:
1 parent
e312131725
commit
f927552adc
2211 files changed
+115416
-540944
No files matched your search
@@ -1,4 +1,4 @@
|
||||
using Code.Infrastructure.Utils;
|
||||
using System;
|
||||
using Code.OfficeGame.BattleMode.Actions.Deciders;
|
||||
using Code.OfficeGame.BattleMode.Timeline;
|
||||
using UnityEngine;
|
||||
@@ -14,7 +14,8 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
BattleActionDecisionResult battleActionDecisionResult,
|
||||
BattleActionData battleActionData)
|
||||
{
|
||||
if (battleActionData is not WaitBattleActionData waitActionData)
|
||||
if (battleActionData is not WaitBattleActionData waitActionData
|
||||
|| battleActionDecisionResult is not CountBattleActionDeciderResult countResult)
|
||||
{
|
||||
battleActionData.Finished = true;
|
||||
return;
|
||||
@@ -30,14 +31,12 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
|
||||
entityAnimator.CrossFadeInFixedTime(EntryStateHash, transitionDurationSeconds);
|
||||
|
||||
// entityAnimator.Play(EntryStateHash, 0, 0f); // Создать None State и кинуть эту штуку туда
|
||||
// entityAnimator.Update(0f);
|
||||
|
||||
// TODO С нормальными анимациями не нужен будет рут моушен√
|
||||
entityAnimator.ResetAnimatorPosition();
|
||||
// entityAnimator.ResetAnimatorPosition();
|
||||
}
|
||||
|
||||
waitActionData.WaitFrames--;
|
||||
|
||||
if (waitActionData.WaitFrames <= 0)
|
||||
{
|
||||
battleActionData.Finished = true;
|
||||
@@ -45,12 +44,14 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
}
|
||||
|
||||
public override BattleActionType ActionType => BattleActionType.Wait;
|
||||
public override DeciderType DeciderType => DeciderType.AsIs;
|
||||
public override DeciderType DeciderType => DeciderType.Count;
|
||||
public override BattleActionData MountAndGetFrames(EntityProperties entity, BattleActionDecisionResult result)
|
||||
{
|
||||
if (result is not CountBattleActionDeciderResult countResult) throw new Exception("Wrong Decider Result");
|
||||
|
||||
WaitBattleActionData actionData = new()
|
||||
{
|
||||
WaitFrames = 120
|
||||
WaitFrames = countResult.Count
|
||||
};
|
||||
|
||||
return actionData;
|
||||
@@ -58,7 +59,15 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
|
||||
public override void Finish(EntityProperties entity, BattleActionData actionData, BattleActionDecisionResult result)
|
||||
{
|
||||
if (actionData is not WaitBattleActionData waitActionData
|
||||
|| result is not CountBattleActionDeciderResult countResult)
|
||||
{
|
||||
actionData.Finished = true;
|
||||
return;
|
||||
}
|
||||
|
||||
actionData.Finished = true;
|
||||
waitActionData.WaitFrames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user