I fixed some

This commit is contained in:
ThomasCharester committed 2026-11-10 19:44:21 +03:00
1 parent 1a75cf8461
commit c0dec163cd
688 files changed
+227631 -198871

No files matched your search

@@ -6,7 +6,7 @@ namespace Code.OfficeGame.BattleMode.Actions
public int TransitionFrames = 60;
public override BattleActionData GetSnapshot()
{
var snapshot = new AttackBattleActionData()
var snapshot = new StuggerActionData()
{
TotalFrames = TotalFrames,
Finished = Finished,
@@ -19,7 +19,7 @@ namespace Code.OfficeGame.BattleMode.Actions
public override void RestoreSnapshot(BattleActionData snapshot)
{
if (snapshot is not AttackBattleActionData neededSnapshot) return;
if (snapshot is not StuggerActionData neededSnapshot) return;
TotalFrames = neededSnapshot.TotalFrames;
Finished = neededSnapshot.Finished;
@@ -91,12 +91,12 @@ namespace Code.OfficeGame.BattleMode.Actions.Attacks
public override void Finish(EntityProperties entity, BattleActionData actionData, BattleActionDecisionResult result)
{
var entityAnimator = entity.animator;
entity.SyncRootMotionToMotor();
entityAnimator.Play(EntryStateHash, 0, 0f);
entityAnimator.Update(0f);
// var entityAnimator = entity.animator;
//
// entity.SyncRootMotionToMotor();
//
// entityAnimator.Play(EntryStateHash, 0, 0f);
// entityAnimator.Update(0f);
}
private void OnEnemyHit(Collider enemyCollider)
@@ -38,7 +38,7 @@ namespace Code.OfficeGame.BattleMode.Actions
{
if (battleActionData is not StuggerActionData stuggerActionData)
{
Debug.Log("WrongData");
Debug.Log($"WrongData {battleActionData.GetType()}");
battleActionData.Finished = true;
return;
}
@@ -45,8 +45,6 @@ namespace Code.OfficeGame.BattleMode.HitBoxes
Collider hitCol = _hitResults[i];
if (hitCol.transform.root == transform.root) continue;
Debug.Log($"Попадание по {hitCol.name}");
onNewTargetHit?.Invoke(hitCol);
}
@@ -10,9 +10,9 @@ namespace Code.OfficeGame.BattleMode.Snapshots
Dictionary<EntityId, BattleActionData> actionDataSnapshots = new();
Dictionary<EntityId, BattleActionDecisionResult> resultsSnapshots = new();
Dictionary<EntityId, EntitySnapshot> entitySnapshots = new();
public void GetSnapshots(
Dictionary<EntityId, EntityProperties> entities,
Dictionary<EntityId, EntityProperties> entities,
Dictionary<EntityId, BattleActionDecisionResult> actionDecisionResults,
Dictionary<EntityId, BattleActionData> battleActionDatas)
{
@@ -24,6 +24,7 @@ namespace Code.OfficeGame.BattleMode.Snapshots
entity.EntityPreviewVisuals.ShowPreviewState(spawnStaticSnapshotGhost: false);
continue;
}
entity.EntityPreviewVisuals.ShowPreviewState(spawnStaticSnapshotGhost: true);
resultsSnapshots[entityId] = actionDecisionResult.GetSnapshot();
@@ -42,28 +43,17 @@ namespace Code.OfficeGame.BattleMode.Snapshots
if (!resultsSnapshots.TryGetValue(entityId, out var actionDecisionResult)
|| !actionDataSnapshots.TryGetValue(entityId, out var battleActionData))
continue;
// bool actionChanged = false;
//
// if (!actionDecisionResults.TryAdd(entityId, actionDecisionResult))
// {
// actionChanged = actionDecisionResult.ActionType
// != actionDecisionResults[entityId].ActionType;
//
// // if (actionChanged)
actionDecisionResults[entityId] = actionDecisionResult.GetSnapshot();
// else
// actionDecisionResults[entityId]?.RestoreSnapshot(actionDecisionResult);
// }
//
// if (!battleActionDatas.TryAdd(entityId, battleActionData))
// {
// if (actionChanged)
battleActionDatas[entityId] = battleActionData.GetSnapshot();
// else
// battleActionDatas[entityId]?.RestoreSnapshot(battleActionData);
// }
if (actionDecisionResults.TryGetValue(entityId, out var currentDecisionResult) && battleActionDatas.TryGetValue(entityId, out var currentActionData))
{
Debug.Log(
$"Restoring {actionDecisionResult.ActionType} of {currentDecisionResult.ActionType} for {entityId}");
Debug.Log(
$"Also {battleActionData} of {currentActionData} for {entityId}");
}
actionDecisionResults[entityId] = actionDecisionResult.GetSnapshot();
battleActionDatas[entityId] = battleActionData.GetSnapshot();
entity.RestoreSnapshot(entitySnapshots[entityId]);
}
}
@@ -450,7 +450,7 @@ namespace Code.OfficeGame.BattleMode.Timeline
_battleActionDatas[entityId] = forcedBattleActionData;
_actionDecisionResults[entityId] = forcedBattleActionDataResult;
Debug.Log($"Задано действие {forcedBattleActionDataResult.ActionType} для {entityId}");
Debug.Log($"Задано действие {forcedBattleActionDataResult.ActionType} для {entityId} with {forcedBattleActionData.GetType()}");
}
}
}