uh you can switch players now
This commit is contained in:
parent
a0bfc600ef
commit
cb4470f2d6
11 changed files with 582 additions and 235 deletions
|
|
@ -14,4 +14,18 @@ public class Entity : MonoBehaviour
|
|||
{
|
||||
|
||||
}
|
||||
protected void FlipSprite(Vector2 lookDirection)
|
||||
{
|
||||
if (lookDirection.x > 0f && stats.isFacingRight)
|
||||
{
|
||||
stats.sprite.flipX = true;
|
||||
stats.isFacingRight = !stats.isFacingRight;
|
||||
}
|
||||
else if (lookDirection.x < 0f && !stats.isFacingRight)
|
||||
{
|
||||
stats.sprite.flipX = false;
|
||||
stats.isFacingRight = !stats.isFacingRight;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue