From ce53952faaab8909bd21e74f7d69fe90e3691648 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Tue, 15 Nov 2022 12:39:18 +0800 Subject: * unitAnimation -> unitMotion --- Erika/Assets/Scripts/Test2/TestErika.cs | 2 +- .../Assets/Scripts/Unit/AfterImage/AfterImageAvatar.cs | 4 ++-- Erika/Assets/Scripts/Unit/AnimatorLayerInfo.cs | 8 ++++---- .../Unit/Components/UnitAnimation/PCAnimation.cs | 4 ++-- Erika/Assets/Scripts/Unit/Components/UnitCollider.cs | 4 ++-- Erika/Assets/Scripts/Unit/Components/UnitSkill.cs | 2 +- .../Unit/Components/UnitState/Erika/PCState_States.cs | 2 +- .../Scripts/Unit/Components/UnitState/MonsterState.cs | 2 +- .../Scripts/Unit/Components/UnitState/UnitState.cs | 14 +++++++------- .../Scripts/Unit/Controller/MonsterController.cs | 4 ++-- Erika/Assets/Scripts/Unit/Controller/PCController.cs | 4 ++-- Erika/Assets/Scripts/Unit/Controller/UnitController.cs | 12 ++++++------ Erika/Assets/Scripts/Unit/TimelineEventProxy.cs | 2 +- Erika/Assets/Scripts/Unit/UnitRootMotion.cs | 18 +++++++++--------- Erika/Assets/Scripts/Unit/UnitSnapshot.cs | 2 +- 15 files changed, 42 insertions(+), 42 deletions(-) diff --git a/Erika/Assets/Scripts/Test2/TestErika.cs b/Erika/Assets/Scripts/Test2/TestErika.cs index f6fc1b41..a658f9a0 100644 --- a/Erika/Assets/Scripts/Test2/TestErika.cs +++ b/Erika/Assets/Scripts/Test2/TestErika.cs @@ -65,7 +65,7 @@ public class TestErika : SingletonMB UnitController unitCtr = erika.unitController.GetOrAddComponent(); unitCtr.Initialize(erika.unit, erika.unitFolder); - //unitCtr.unitAnimation.m_ActionData = erika.actionData; + //unitCtr.unitMotion.m_ActionData = erika.actionData; UnitRootMotion unitRootMotion = unitCtr.unitRootMotion; diff --git a/Erika/Assets/Scripts/Unit/AfterImage/AfterImageAvatar.cs b/Erika/Assets/Scripts/Unit/AfterImage/AfterImageAvatar.cs index ec29b364..170a1202 100644 --- a/Erika/Assets/Scripts/Unit/AfterImage/AfterImageAvatar.cs +++ b/Erika/Assets/Scripts/Unit/AfterImage/AfterImageAvatar.cs @@ -29,8 +29,8 @@ public class AfterImageAvatar : MonoBehaviour { transform.position = prototype.transform.position; - animator.runtimeAnimatorController = prototype.unitAnimation.animator.runtimeAnimatorController; - animator.Play(prototype.unitAnimation.stateHash, 0, prototype.unitAnimation.playbackNormalizedTime); + animator.runtimeAnimatorController = prototype.unitMotion.animator.runtimeAnimatorController; + animator.Play(prototype.unitMotion.stateHash, 0, prototype.unitMotion.playbackNormalizedTime); animator.speed = 0.02f; animator.Update(1 / 60f); diff --git a/Erika/Assets/Scripts/Unit/AnimatorLayerInfo.cs b/Erika/Assets/Scripts/Unit/AnimatorLayerInfo.cs index 0cada209..ecc4daa4 100644 --- a/Erika/Assets/Scripts/Unit/AnimatorLayerInfo.cs +++ b/Erika/Assets/Scripts/Unit/AnimatorLayerInfo.cs @@ -181,13 +181,13 @@ public class AnimatorLayerInfo public string m_CurrentState; - public AnimatorLayerInfo(UnitMotion unitAnimation, Animator animator, int layer) + public AnimatorLayerInfo(UnitMotion unitMotion, Animator animator, int layer) { - this.m_UnitAnimation = unitAnimation; + this.m_UnitAnimation = unitMotion; this.m_Animator = animator; this.layer = layer; - m_CalcPlaybackTimeCoroutine = unitAnimation.StartCoroutine(CalcPlaybackRealTimeCoroutine()); - m_TimelineEventProxy = new TimelineEventProxy(unitAnimation.owner); + m_CalcPlaybackTimeCoroutine = unitMotion.StartCoroutine(CalcPlaybackRealTimeCoroutine()); + m_TimelineEventProxy = new TimelineEventProxy(unitMotion.owner); applySpeedCurve = true; } diff --git a/Erika/Assets/Scripts/Unit/Components/UnitAnimation/PCAnimation.cs b/Erika/Assets/Scripts/Unit/Components/UnitAnimation/PCAnimation.cs index 568716f3..ed6a305b 100644 --- a/Erika/Assets/Scripts/Unit/Components/UnitAnimation/PCAnimation.cs +++ b/Erika/Assets/Scripts/Unit/Components/UnitAnimation/PCAnimation.cs @@ -83,8 +83,8 @@ public class PCAnimation : UnitMotion { get { - Debug.Assert(owner.unitAnimation.animator.runtimeAnimatorController is AnimatorOverrideController); - return owner.unitAnimation.animator.runtimeAnimatorController as AnimatorOverrideController; + Debug.Assert(owner.unitMotion.animator.runtimeAnimatorController is AnimatorOverrideController); + return owner.unitMotion.animator.runtimeAnimatorController as AnimatorOverrideController; } } diff --git a/Erika/Assets/Scripts/Unit/Components/UnitCollider.cs b/Erika/Assets/Scripts/Unit/Components/UnitCollider.cs index 348ceae5..1d216a06 100644 --- a/Erika/Assets/Scripts/Unit/Components/UnitCollider.cs +++ b/Erika/Assets/Scripts/Unit/Components/UnitCollider.cs @@ -45,8 +45,8 @@ public class UnitCollider : UnitComponent /// public ColliderInfo[] GetCurrentBoxesInfoByType(ColliderBox.EColliderType type) { - AnimationData animData = m_Owner.unitAnimation.animationData; - float playbackTime = m_Owner.unitAnimation.playbackNormalizedTime * m_Owner.unitAnimation.animationClip.length; + AnimationData animData = m_Owner.unitMotion.animationData; + float playbackTime = m_Owner.unitMotion.playbackNormalizedTime * m_Owner.unitMotion.animationClip.length; //float playbackTime = layerInfo.playbackRealTimeInSeconds; ColliderInfo[] infos = animData.GetActiveCollidersInfo(type, playbackTime); return infos; diff --git a/Erika/Assets/Scripts/Unit/Components/UnitSkill.cs b/Erika/Assets/Scripts/Unit/Components/UnitSkill.cs index 7acf8e5f..4af856f2 100644 --- a/Erika/Assets/Scripts/Unit/Components/UnitSkill.cs +++ b/Erika/Assets/Scripts/Unit/Components/UnitSkill.cs @@ -18,7 +18,7 @@ public class UnitSkill : UnitComponent { get { - return owner.unitAnimation; + return owner.unitMotion; } } diff --git a/Erika/Assets/Scripts/Unit/Components/UnitState/Erika/PCState_States.cs b/Erika/Assets/Scripts/Unit/Components/UnitState/Erika/PCState_States.cs index 260906a0..16a099d7 100644 --- a/Erika/Assets/Scripts/Unit/Components/UnitState/Erika/PCState_States.cs +++ b/Erika/Assets/Scripts/Unit/Components/UnitState/Erika/PCState_States.cs @@ -44,7 +44,7 @@ public partial class PCState : UnitState IEnumerator Idle(IdleParam param) { //m_Owner.pcAnimation.AnimIdle(); - yield return new WaitForTransitionDone(owner.unitAnimation); + yield return new WaitForTransitionDone(owner.unitMotion); m_Owner.SetYPosition(0); while (true) { diff --git a/Erika/Assets/Scripts/Unit/Components/UnitState/MonsterState.cs b/Erika/Assets/Scripts/Unit/Components/UnitState/MonsterState.cs index dcdb7281..e6b526f7 100644 --- a/Erika/Assets/Scripts/Unit/Components/UnitState/MonsterState.cs +++ b/Erika/Assets/Scripts/Unit/Components/UnitState/MonsterState.cs @@ -29,7 +29,7 @@ public class MonsterState : UnitState [SerializeField] private EUnitState m_State; public EUnitState CurrentState { get { return m_State; } } - UnitMotion unitAnimation { get { return m_Owner.unitAnimation; } } + UnitMotion unitMotion { get { return m_Owner.unitMotion; } } public override void Initialize() { diff --git a/Erika/Assets/Scripts/Unit/Components/UnitState/UnitState.cs b/Erika/Assets/Scripts/Unit/Components/UnitState/UnitState.cs index e9843310..924b3014 100644 --- a/Erika/Assets/Scripts/Unit/Components/UnitState/UnitState.cs +++ b/Erika/Assets/Scripts/Unit/Components/UnitState/UnitState.cs @@ -16,7 +16,7 @@ public class UnitState : UnitComponent { get { - return owner.unitAnimation.playbackNormalizedTime == 1; + return owner.unitMotion.playbackNormalizedTime == 1; } } @@ -25,9 +25,9 @@ public class UnitState : UnitComponent { get { - if (!owner.unitAnimation.animationData.HasProperty(EAnimationProperty.Endpoint)) + if (!owner.unitMotion.animationData.HasProperty(EAnimationProperty.Endpoint)) return false; - return owner.unitAnimation.playbackNormalizedTime >= owner.unitAnimation.animationData.GetProperty(EAnimationProperty.Endpoint); + return owner.unitMotion.playbackNormalizedTime >= owner.unitMotion.animationData.GetProperty(EAnimationProperty.Endpoint); } } @@ -35,7 +35,7 @@ public class UnitState : UnitComponent { get { - return owner.unitAnimation.IsToggleOpen(EAnimationToogle.Combo); + return owner.unitMotion.IsToggleOpen(EAnimationToogle.Combo); } } @@ -43,21 +43,21 @@ public class UnitState : UnitComponent { get { - return owner.unitAnimation.IsToggleOpen(EAnimationToogle.SkillLink); + return owner.unitMotion.IsToggleOpen(EAnimationToogle.SkillLink); } } public virtual bool isMoveLink { get { - return owner.unitAnimation.IsToggleOpen(EAnimationToogle.MoveLink); + return owner.unitMotion.IsToggleOpen(EAnimationToogle.MoveLink); } } public virtual bool isLink { get { - return owner.unitAnimation.IsToggleOpen(EAnimationToogle.Link); + return owner.unitMotion.IsToggleOpen(EAnimationToogle.Link); } } diff --git a/Erika/Assets/Scripts/Unit/Controller/MonsterController.cs b/Erika/Assets/Scripts/Unit/Controller/MonsterController.cs index ef3e5308..28123cdc 100644 --- a/Erika/Assets/Scripts/Unit/Controller/MonsterController.cs +++ b/Erika/Assets/Scripts/Unit/Controller/MonsterController.cs @@ -13,8 +13,8 @@ public class MonsterController : UnitController unitState = GetOrAddUnitComponent(); unitState.Initialize(); - //unitAnimation = GetOrAddUnitComponent(); - //unitAnimation.Initialize(); + //unitMotion = GetOrAddUnitComponent(); + //unitMotion.Initialize(); } public override void Update() diff --git a/Erika/Assets/Scripts/Unit/Controller/PCController.cs b/Erika/Assets/Scripts/Unit/Controller/PCController.cs index 94ba6e25..a8862b2d 100644 --- a/Erika/Assets/Scripts/Unit/Controller/PCController.cs +++ b/Erika/Assets/Scripts/Unit/Controller/PCController.cs @@ -27,8 +27,8 @@ public class PCController : UnitController unitState = GetOrAddUnitComponent(); unitState.Initialize(); - //unitAnimation = GetOrAddUnitComponent(); - //unitAnimation.Initialize(); + //unitMotion = GetOrAddUnitComponent(); + //unitMotion.Initialize(); unitAfterImage = GetOrAddUnitComponent(); unitAfterImage.Initialize(); diff --git a/Erika/Assets/Scripts/Unit/Controller/UnitController.cs b/Erika/Assets/Scripts/Unit/Controller/UnitController.cs index 711b914b..29adff5a 100644 --- a/Erika/Assets/Scripts/Unit/Controller/UnitController.cs +++ b/Erika/Assets/Scripts/Unit/Controller/UnitController.cs @@ -33,9 +33,9 @@ public class UnitController : MonoBehaviour/*, Interactable*/ public PCState pcState { get { return unitState as PCState; } } public MonsterState monsterState { get { return unitState as MonsterState; } } - public UnitMotion unitAnimation; - //public PCAnimation pcAnimation { get { return unitAnimation as PCAnimation; } } - //public MonsterAnimation monsterAnimation { get { return unitAnimation as MonsterAnimation; } } + public UnitMotion unitMotion; + //public PCAnimation pcAnimation { get { return unitMotion as PCAnimation; } } + //public MonsterAnimation monsterAnimation { get { return unitMotion as MonsterAnimation; } } public UnitSkill unitSkill; @@ -252,7 +252,7 @@ public class UnitController : MonoBehaviour/*, Interactable*/ { unitRender.OnUpdate(); unitState.OnUpdate(); - unitAnimation.OnUpdate(); + unitMotion.OnUpdate(); unitSkill.OnUpdate(); unitRootMotion.OnUpdate(); unitLensEffect.OnUpdate(); @@ -288,8 +288,8 @@ public class UnitController : MonoBehaviour/*, Interactable*/ UnitSnapshotInfo snapshot = new UnitSnapshotInfo(); snapshot.trs = new TRS(unitObj.transform.position, unitObj.transform.rotation, unitObj.transform.lossyScale); snapshot.unit = this; - snapshot.animStateHash = unitAnimation.stateHash; - snapshot.normalizedTime = unitAnimation.playbackNormalizedTime; + snapshot.animStateHash = unitMotion.stateHash; + snapshot.normalizedTime = unitMotion.playbackNormalizedTime; return snapshot; } diff --git a/Erika/Assets/Scripts/Unit/TimelineEventProxy.cs b/Erika/Assets/Scripts/Unit/TimelineEventProxy.cs index 21a474cb..98e5a738 100644 --- a/Erika/Assets/Scripts/Unit/TimelineEventProxy.cs +++ b/Erika/Assets/Scripts/Unit/TimelineEventProxy.cs @@ -97,7 +97,7 @@ public partial class TimelineEventProxy public UnitController owner { get; private set; } - private UnitMotion m_UnitAnimation { get { return owner.unitAnimation; } } + private UnitMotion m_UnitAnimation { get { return owner.unitMotion; } } private AnimationData m_PrevAnimationData; diff --git a/Erika/Assets/Scripts/Unit/UnitRootMotion.cs b/Erika/Assets/Scripts/Unit/UnitRootMotion.cs index 20562920..c8df0729 100644 --- a/Erika/Assets/Scripts/Unit/UnitRootMotion.cs +++ b/Erika/Assets/Scripts/Unit/UnitRootMotion.cs @@ -39,8 +39,8 @@ public class UnitRootMotion : UnitComponent { base.OnUpdate(); - var state = m_Owner.unitAnimation.curState; - float playbackTime = m_Owner.unitAnimation.playbackTime; + var state = m_Owner.unitMotion.curState; + float playbackTime = m_Owner.unitMotion.playbackTime; var rootMotion = m_RootMotionDic[state]; float normalTime = (playbackTime % rootMotion.animationLength) / rootMotion.animationLength; @@ -83,12 +83,12 @@ public class UnitRootMotion : UnitComponent public void UpdateRootMotion() { - bool overrideRootMotion = m_Owner.unitAnimation.animationData.overrideRootMotion; + bool overrideRootMotion = m_Owner.unitMotion.animationData.overrideRootMotion; if(overrideRootMotion) { - var rmData = m_Owner.unitAnimation.animationData.rootMotionOverrideData; - float frame = m_Owner.unitAnimation.playbackNormalizedTime * m_Owner.unitAnimation.animationClip.length * TimelineEventProxy.FPS; - var animData = m_Owner.unitAnimation.animationData; + var rmData = m_Owner.unitMotion.animationData.rootMotionOverrideData; + float frame = m_Owner.unitMotion.playbackNormalizedTime * m_Owner.unitMotion.animationClip.length * TimelineEventProxy.FPS; + var animData = m_Owner.unitMotion.animationData; if(animData != m_PrevAnimationData) { m_PrevAnimationData = animData; @@ -110,10 +110,10 @@ public class UnitRootMotion : UnitComponent else { // 因为Unit被旋转了90度,所以这里的deltaPosition的forward是x方向了 - Vector3 dest = m_Owner.unitAnimation.animator.deltaPosition; + Vector3 dest = m_Owner.unitMotion.animator.deltaPosition; dest.z = 0; - var state = m_Owner.unitAnimation.stateInfo; - bool ignoreY = m_Owner.unitAnimation.animationData.GetProperty(EAnimationProperty.IgnoreY, 0) != 0; + var state = m_Owner.unitMotion.stateInfo; + bool ignoreY = m_Owner.unitMotion.animationData.GetProperty(EAnimationProperty.IgnoreY, 0) != 0; if (state.IsTag("IgnoreY") || ignoreY) { dest.y = 0; diff --git a/Erika/Assets/Scripts/Unit/UnitSnapshot.cs b/Erika/Assets/Scripts/Unit/UnitSnapshot.cs index f43189cb..e257a3c2 100644 --- a/Erika/Assets/Scripts/Unit/UnitSnapshot.cs +++ b/Erika/Assets/Scripts/Unit/UnitSnapshot.cs @@ -38,7 +38,7 @@ public class UnitSnapshot : MonoBehaviour public void Initialize(UnitController prototype) { owner = prototype; - animator.runtimeAnimatorController = prototype.unitAnimation.animator.runtimeAnimatorController; + animator.runtimeAnimatorController = prototype.unitMotion.animator.runtimeAnimatorController; animator.speed = 0; } -- cgit v1.1-26-g67d0