diff options
author | chai <chaifix@163.com> | 2021-09-29 19:55:57 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-09-29 19:55:57 +0800 |
commit | 61d6e9bf192ffa54abc57bab69b1bd88c3b8d62b (patch) | |
tree | 47071b43d583ced63b1b6cc4a9e4c2c6100ffe3f /Assets/Scripts/Unit/Controller/UnitController.cs | |
parent | 16e4a47beaf7786b63404d4a8356e45d70a393b5 (diff) |
*misc
Diffstat (limited to 'Assets/Scripts/Unit/Controller/UnitController.cs')
-rw-r--r-- | Assets/Scripts/Unit/Controller/UnitController.cs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Assets/Scripts/Unit/Controller/UnitController.cs b/Assets/Scripts/Unit/Controller/UnitController.cs index 34490feb..c75b32b3 100644 --- a/Assets/Scripts/Unit/Controller/UnitController.cs +++ b/Assets/Scripts/Unit/Controller/UnitController.cs @@ -42,6 +42,8 @@ public class UnitController : MonoBehaviour/*, Interactable*/ public UnitBody unitBody;
+ public UnitLensEffect unitLensEffect;
+
public GameObject unitObj; // 角色模型
protected List<UnitComponent> unitComponents;
@@ -93,6 +95,18 @@ public class UnitController : MonoBehaviour/*, Interactable*/ }
}
+ public TRS trs
+ {
+ get
+ {
+ TRS trs = new TRS();
+ trs.position = position;
+ trs.rotation = rotation;
+ trs.scale = lossyScale;
+ return trs;
+ }
+ }
+
public virtual Vector3 center
{
get
@@ -166,6 +180,9 @@ public class UnitController : MonoBehaviour/*, Interactable*/ unitRender = GetOrAddUnitComponent<UnitRender>();
unitRender.Initialize();
+ unitLensEffect = GetOrAddUnitComponent<UnitLensEffect>();
+ unitLensEffect.Initialize();
+
unitDetail = gameObject.GetComponentInChildren<UnitDetail>();
}
@@ -194,7 +211,8 @@ public class UnitController : MonoBehaviour/*, Interactable*/ unitAnimation.OnUpdate();
unitSkill.OnUpdate();
unitRootMotion.OnUpdate();
- }
+ unitLensEffect.OnUpdate();
+ }
public virtual void OnDestroy()
{
@@ -232,6 +250,7 @@ public class UnitController : MonoBehaviour/*, Interactable*/ public UnitSnapshotInfo TakeSnapshot()
{
UnitSnapshotInfo snapshot = new UnitSnapshotInfo();
+ snapshot.trs = new TRS(unitObj.transform.position, unitObj.transform.rotation, unitObj.transform.lossyScale);
snapshot.unit = this;
snapshot.animStateHash = unitAnimation.baseLayer.stateHash;
snapshot.normalizedTime = unitAnimation.baseLayer.playbackNormalizedTime;
|