mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 11:37:41 +02:00
Spaceball camera and perspective fixes + Karate Man animated background
This commit is contained in:
@ -15,11 +15,51 @@ namespace RhythmHeavenMania.Games.KarateMan
|
||||
|
||||
public Sprite[] ObjectSprites;
|
||||
|
||||
public List<BGSpriteC> BGSprites;
|
||||
public SpriteRenderer BGSprite;
|
||||
|
||||
private bool bgEnabled;
|
||||
private int newBeat;
|
||||
|
||||
[System.Serializable]
|
||||
public class BGSpriteC
|
||||
{
|
||||
public List<Sprite> Sprites;
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (bgEnabled)
|
||||
{
|
||||
if (Conductor.instance.songPositionInBeats > newBeat)
|
||||
{
|
||||
if (newBeat % 2 == 0)
|
||||
BGSprite.sprite = BGSprites[0].Sprites[1];
|
||||
else
|
||||
BGSprite.sprite = BGSprites[0].Sprites[2];
|
||||
|
||||
newBeat++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void BGFXOn()
|
||||
{
|
||||
bgEnabled = true;
|
||||
newBeat = Mathf.RoundToInt(Conductor.instance.songPositionInBeats);
|
||||
}
|
||||
|
||||
public void BGFXOff()
|
||||
{
|
||||
bgEnabled = false;
|
||||
BGSprite.sprite = BGSprites[0].Sprites[0];
|
||||
}
|
||||
|
||||
public void Shoot(float beat, int type)
|
||||
{
|
||||
GameObject pot = Instantiate(Pot);
|
||||
@ -48,6 +88,10 @@ namespace RhythmHeavenMania.Games.KarateMan
|
||||
Jukebox.PlayOneShotGame("karateman/objectOut");
|
||||
p.hitSnd = "karateman/rockHit";
|
||||
break;
|
||||
case 3:
|
||||
Jukebox.PlayOneShotGame("karateman/objectOut");
|
||||
p.hitSnd = "karateman/soccerHit";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user