mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 08:27:40 +02:00
Spaceball costumes
This commit is contained in:
@ -14,6 +14,17 @@ namespace RhythmHeavenMania.Games.Spaceball
|
||||
public List<Minigame.Eligible> EligibleHits = new List<Minigame.Eligible>();
|
||||
[SerializeField] private int currentHitInList = 0;
|
||||
|
||||
public int costume;
|
||||
|
||||
public SpriteRenderer PlayerSprite;
|
||||
public List<SpriteSheet> PlayerSpriteSheets = new List<SpriteSheet>();
|
||||
|
||||
[System.Serializable]
|
||||
public class SpriteSheet
|
||||
{
|
||||
public List<Sprite> sprites;
|
||||
}
|
||||
|
||||
public static SpaceballPlayer instance { get; set; }
|
||||
|
||||
private void Awake()
|
||||
@ -37,6 +48,12 @@ namespace RhythmHeavenMania.Games.Spaceball
|
||||
}
|
||||
}
|
||||
|
||||
public void SetCostume(int costume)
|
||||
{
|
||||
this.costume = costume;
|
||||
anim.Play("Idle", 0, 0);
|
||||
}
|
||||
|
||||
public void Swing()
|
||||
{
|
||||
bool canHit = (EligibleHits.Count > 0) && (currentHitInList < EligibleHits.Count);
|
||||
@ -70,9 +87,15 @@ namespace RhythmHeavenMania.Games.Spaceball
|
||||
}
|
||||
else
|
||||
Jukebox.PlayOneShotGame("spaceball/swing");
|
||||
|
||||
anim.Play("Swing", 0, 0);
|
||||
}
|
||||
|
||||
public void SetSprite(int id)
|
||||
{
|
||||
PlayerSprite.sprite = PlayerSpriteSheets[costume].sprites[id];
|
||||
}
|
||||
|
||||
private void RemoveBall()
|
||||
{
|
||||
if (currentHitInList < EligibleHits.Count)
|
||||
|
Reference in New Issue
Block a user