diff options
Diffstat (limited to 'Assets/Scripts/Unit/Controller')
-rw-r--r-- | Assets/Scripts/Unit/Controller/UnitController.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Assets/Scripts/Unit/Controller/UnitController.cs b/Assets/Scripts/Unit/Controller/UnitController.cs index 3b4ab12d..34490feb 100644 --- a/Assets/Scripts/Unit/Controller/UnitController.cs +++ b/Assets/Scripts/Unit/Controller/UnitController.cs @@ -228,5 +228,14 @@ public class UnitController : MonoBehaviour/*, Interactable*/ transform.position = pos;
}
-}
+ // 生成当前的快照
+ public UnitSnapshotInfo TakeSnapshot()
+ {
+ UnitSnapshotInfo snapshot = new UnitSnapshotInfo();
+ snapshot.unit = this;
+ snapshot.animStateHash = unitAnimation.baseLayer.stateHash;
+ snapshot.normalizedTime = unitAnimation.baseLayer.playbackNormalizedTime;
+ return snapshot;
+ }
+}
\ No newline at end of file |