Added intermission1
This commit is contained in:
@@ -34,6 +34,17 @@
|
||||
[UdonSynced] private float freezeSeconds;
|
||||
[UdonSynced] private bool frozen;
|
||||
|
||||
#region Animator constants
|
||||
private const string AnimatorKeyDead = "Dead";
|
||||
private const string AnimatorKeyDirection = "Direction";
|
||||
private const float AnimatorDirectionNone = 0f;
|
||||
private const float AnimatorDirectionRight = 0.25f;
|
||||
private const float AnimatorDirectionLeft = 0.50f;
|
||||
private const float AnimatorDirectionUp = 0.75f;
|
||||
private const float AnimatorDirectionDown = 1f;
|
||||
private const float AnimatorDirectionRightBig = 1.25f;
|
||||
#endregion
|
||||
|
||||
|
||||
public void Initialize(PlayerInput input, VRCObjectPool pelletPool, GameManager gameController)
|
||||
{
|
||||
@@ -202,7 +213,7 @@
|
||||
if (!gameObject.activeInHierarchy)
|
||||
return;
|
||||
|
||||
animator.SetBool("Dead", dead);
|
||||
animator.SetBool(AnimatorKeyDead, dead);
|
||||
if (dead)
|
||||
{
|
||||
animator.speed = 1;
|
||||
@@ -211,7 +222,7 @@
|
||||
|
||||
if (frozen || direction.Equals(Vector2.zero))
|
||||
{
|
||||
animator.SetFloat("Direction", 0f);
|
||||
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionNone);
|
||||
animator.speed = 0;
|
||||
}
|
||||
else
|
||||
@@ -219,31 +230,23 @@
|
||||
animator.speed = 1;
|
||||
if (targetDirection.Equals(Vector2.right))
|
||||
{
|
||||
animator.SetFloat("Direction", 0.25f);
|
||||
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionRight);
|
||||
}
|
||||
else if (targetDirection.Equals(Vector2.left))
|
||||
{
|
||||
animator.SetFloat("Direction", 0.5f);
|
||||
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionLeft);
|
||||
}
|
||||
else if (targetDirection.Equals(Vector2.up))
|
||||
{
|
||||
animator.SetFloat("Direction", 0.75f);
|
||||
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionUp);
|
||||
}
|
||||
else if (targetDirection.Equals(Vector2.down))
|
||||
{
|
||||
animator.SetFloat("Direction", 1f);
|
||||
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionDown);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// public Vector2 GetTarget(Vector2 gridPosition, Vector2 currentDirection) {
|
||||
// Vector2 nextDirection = input.GetRotatedDirection();
|
||||
// if(!nextDirection.Equals(currentDirection) && !GridMoverTools.CheckCollisionInDirection(transform, gridPosition, nextDirection)) {
|
||||
// return nextDirection;
|
||||
// }
|
||||
// return Vector2.zero;
|
||||
// }
|
||||
|
||||
public void SetDead(bool dead)
|
||||
{
|
||||
this.dead = dead;
|
||||
@@ -303,6 +306,11 @@
|
||||
predefinedPathIndex = 0;
|
||||
}
|
||||
|
||||
public void BecomeBig()
|
||||
{
|
||||
animator.SetFloat(AnimatorKeyDirection, AnimatorDirectionRightBig);
|
||||
}
|
||||
|
||||
void SetVisibility(bool visible)
|
||||
{
|
||||
renderer.enabled = visible;
|
||||
|
||||
Reference in New Issue
Block a user