From 16e4a47beaf7786b63404d4a8356e45d70a393b5 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 28 Sep 2021 19:12:34 +0800 Subject: *unit lens --- Assets/Scripts/Unit/Controller/UnitController.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Assets/Scripts/Unit/Controller/UnitController.cs') 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 -- cgit v1.1-26-g67d0