private void UpdateSprites() { currentAimAngle = AimHelper.GetCurrentAimAngle(targetPosition, transform.position); if (currentAimAngle != lastAimAngle) { if (currentAimAngle.y == Enums.Angles.Y.Top) { mySpriteRenderer.sprite = lookingUpSprite; } else { mySpriteRenderer.sprite = lookingDownSprite; } if (currentAimAngle.x == Enums.Angles.X.Left) { myGun.SetBehindEntity(true, mySpriteRenderer); } else { myGun.SetBehindEntity(false, mySpriteRenderer); } if ((lastAimAngle == null && currentAimAngle.x == Enums.Angles.X.Left) || (lastAimAngle != null && currentAimAngle.x != lastAimAngle.x)) { Flip(); } } }
public virtual void UpdateCacheVariables() { lastAimAngle = currentAimAngle; myAnimator.SetBool("isMoving", isMoving); myAnimator.SetBool("isLookingUp", isLookingUp); myAnimator.SetBool("isDead", isDead); }
private void UpdateSprites() { if (!isDead) { currentAimAngle = AimHelper.GetCurrentAimAngle(targetPosition, transform.position); if (currentAimAngle != lastAimAngle) { isLookingUp = currentAimAngle.y == Enums.Angles.Y.Top; if ((lastAimAngle == null && currentAimAngle.x == Enums.Angles.X.Left) || (lastAimAngle != null && currentAimAngle.x != lastAimAngle.x)) { Flip(); } } } }
public virtual void UpdateCacheVariables() { lastAimAngle = currentAimAngle; }