Added blocking animation
This commit is contained in:
@@ -17,7 +17,8 @@ namespace InterfaceOff.WorldScene
|
||||
[SerializeField] private int[] DeathIndices;
|
||||
[SerializeField] private ExternalCamera ExternalCamera;
|
||||
[SerializeField] private Image FrontLayerImage;
|
||||
[SerializeField] private Animator PlayerAnimator;
|
||||
[SerializeField] private GameObject StillObject;
|
||||
[SerializeField] private GameObject MovingObject;
|
||||
|
||||
private const int MAX_WINDOWS = 20;
|
||||
|
||||
@@ -30,6 +31,12 @@ namespace InterfaceOff.WorldScene
|
||||
Frames = JsonUtility.FromJson<PlayerFrameInfoArray>(PlayerFrameDump.DUMPED_STRING).FrameInfo;
|
||||
}
|
||||
|
||||
private void SetAnimationState(bool active)
|
||||
{
|
||||
StillObject.SetActive(active);
|
||||
MovingObject.SetActive(!active);
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if (PlayerAlive)
|
||||
@@ -47,8 +54,6 @@ namespace InterfaceOff.WorldScene
|
||||
|
||||
private void Update()
|
||||
{
|
||||
PlayerAnimator.Play("Block");
|
||||
|
||||
if (PlayerAlive)
|
||||
{
|
||||
/* Updates the position according to the lerp */
|
||||
@@ -62,12 +67,8 @@ namespace InterfaceOff.WorldScene
|
||||
Vector2 rotation = Vector2.Lerp(frameA.Rotation, frameB.Rotation, LerpValue);
|
||||
transform.rotation = Quaternion.Euler(rotation.x, rotation.y, 0);
|
||||
|
||||
/* Updates the gun state */
|
||||
BulletTracerRenderer.positionCount = 2;
|
||||
BulletTracerRenderer.SetPosition(index: 0, BulletTracerStart.position);
|
||||
BulletTracerRenderer.SetPosition(index: 1, BulletTracerEnd.position);
|
||||
|
||||
BulletTracerRenderer.enabled = Frames[FrameIndex].ShootGun;
|
||||
/* Updates the blocking state */
|
||||
SetAnimationState(!Frames[FrameIndex].ShootGun);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user