mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 20:47:39 +02:00
Added Streaks and Set Background Color to Drumming Practice
This commit is contained in:
@ -65,8 +65,10 @@ namespace HeavenStudio.Games.Scripts_DrummingPractice
|
||||
if(player && force)
|
||||
{
|
||||
if (hit)
|
||||
{
|
||||
HitSound(applause);
|
||||
else
|
||||
DrummingPractice.instance.Streak();
|
||||
} else
|
||||
MissSound();
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,9 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
|
||||
[Header("References")]
|
||||
public SpriteRenderer background;
|
||||
public SpriteRenderer backgroundGradient;
|
||||
public SpriteRenderer[] streaks;
|
||||
public Drummer player;
|
||||
public Drummer leftDrummer;
|
||||
public Drummer rightDrummer;
|
||||
@ -58,6 +60,12 @@ namespace HeavenStudio.Games
|
||||
Bop();
|
||||
}
|
||||
}
|
||||
|
||||
foreach (SpriteRenderer streak in streaks)
|
||||
{
|
||||
Color col = streak.color;
|
||||
streak.color = new Color(col.r, col.g, col.b, Mathf.Lerp(col.a, 0, 3.5f * Time.deltaTime));
|
||||
}
|
||||
}
|
||||
|
||||
public void SetBop(float beat, float length)
|
||||
@ -145,5 +153,24 @@ namespace HeavenStudio.Games
|
||||
SetFaces(0);
|
||||
}
|
||||
|
||||
public void SetBackgroundColor(Color col1, Color col2, Color col3)
|
||||
{
|
||||
backgroundGradient.color = col1;
|
||||
background.color = col2;
|
||||
foreach(SpriteRenderer streak in streaks)
|
||||
{
|
||||
streak.color = new Color(col3.r, col3.g, col3.b, streak.color.a);
|
||||
}
|
||||
}
|
||||
|
||||
public void Streak()
|
||||
{
|
||||
foreach (SpriteRenderer streak in streaks)
|
||||
{
|
||||
Color col = streak.color;
|
||||
streak.color = new Color(col.r, col.g, col.b, 0.7f);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user