Exaction timelinetion
This commit is contained in:
1 parent
921c4125b7
commit
0288afb00a
722 files changed
+144715
-152451
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user