Fix BulletHole position flipping
This commit is contained in:
parent
1ac0fedddf
commit
90285f75eb
@ -20,6 +20,12 @@ namespace Saltosion.OneWeapon.Guns {
|
||||
private Bullet CurrentBullet;
|
||||
private bool HasShotBullet = false;
|
||||
|
||||
private float BulletHoleOriginalY;
|
||||
|
||||
void Start() {
|
||||
BulletHoleOriginalY = BulletHole.localPosition.y;
|
||||
}
|
||||
|
||||
void Update() {
|
||||
if (CurrCooldown > 0) {
|
||||
CurrCooldown -= Time.deltaTime;
|
||||
@ -66,6 +72,11 @@ namespace Saltosion.OneWeapon.Guns {
|
||||
|
||||
public void FlipGun(bool flipped) {
|
||||
Sprite.flipY = flipped;
|
||||
float y = BulletHoleOriginalY;
|
||||
if (flipped) {
|
||||
y = -y;
|
||||
}
|
||||
BulletHole.localPosition = new Vector2(BulletHole.localPosition.x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user