breakpoint
before change animation type
This commit is contained in:
@@ -22,6 +22,8 @@ namespace BITFALL.Entites
|
||||
[Inject] private IEntityOverride _override;
|
||||
|
||||
private readonly List<(Transform transform,Vector3 initialPosition, Quaternion initialRotation)> _initialJoint = new();
|
||||
|
||||
private bool _updateNextFrame;
|
||||
public override void OnStart()
|
||||
{
|
||||
base.OnStart();
|
||||
@@ -44,7 +46,16 @@ namespace BITFALL.Entites
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override void OnUpdate(float deltaTime)
|
||||
{
|
||||
base.OnUpdate(deltaTime);
|
||||
if (_updateNextFrame)
|
||||
{
|
||||
EnsurePhysicsAnimation();
|
||||
_updateNextFrame = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void EnsurePhysicsAnimation()
|
||||
{
|
||||
@@ -56,13 +67,22 @@ namespace BITFALL.Entites
|
||||
}
|
||||
else
|
||||
{
|
||||
animator.enabled = _health.IsAlive;
|
||||
if (_override is not null)
|
||||
{
|
||||
animator.enabled = _health.IsAlive || _override.IsOvering;
|
||||
}
|
||||
else
|
||||
{
|
||||
animator.enabled = _health.IsAlive;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void OnOverride(bool obj)
|
||||
{
|
||||
EnsurePhysicsAnimation();
|
||||
//EnsurePhysicsAnimation();
|
||||
_updateNextFrame = true;
|
||||
}
|
||||
public void OnSetAlive(bool alive)
|
||||
{
|
||||
@@ -76,7 +96,8 @@ namespace BITFALL.Entites
|
||||
x.transform.localPosition = x.initialPosition;
|
||||
}
|
||||
}
|
||||
EnsurePhysicsAnimation();
|
||||
//EnsurePhysicsAnimation();
|
||||
_updateNextFrame = true;
|
||||
}
|
||||
|
||||
public void OnSetHP(int hp)
|
||||
|
Reference in New Issue
Block a user