Exaction timelinetion

This commit is contained in:
ThomasCharester committed 2026-11-06 19:40:08 +03:00
1 parent 921c4125b7
commit 0288afb00a
722 files changed
+144715 -152451

No files matched your search

+21 -1
View File
@@ -1,9 +1,29 @@
using Code.OfficeGame.BattleMode.Actions;
using KinematicCharacterController;
using UnityEngine;
namespace Code.Game.Entities
{
public static class EntitySnapshotExtensions
public static class EntityExtensions
{
// WC
public static void SyncRootMotionToMotor(this EntityProperties entity, bool syncRotation = true)
{
Transform animTransform = entity.animator.transform;
KinematicCharacterMotor motor = entity.KinematicCharacterMotor;
Vector3 targetWorldPos = animTransform.position;
Quaternion targetWorldRot = syncRotation
? animTransform.rotation
: motor.TransientRotation;
animTransform.localPosition = Vector3.zero;
animTransform.localRotation = Quaternion.identity;
motor.SetPositionAndRotation(targetWorldPos, targetWorldRot);
motor.BaseVelocity = Vector3.zero;
}
public static EntitySnapshot GetSnapshot(this EntityProperties entityProperties)
{
return EntitySnapshot.GetSnapshot(entityProperties);