mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 17:57:39 +02:00
Clappy Trio and Fork Lifter finished + small additions/fixes (#400)
* The funny * Yar har har har * 1 two tree * Hilarious! * procedurally spawning in stuff * bored meeting * A lot! * Assistant stop added * Added Bops * Added Sounds * Added miss stuff!! Only need the miss anim for the pigs!!! * Tweaks * Bugfixes! * anim fix anim fix * STRAIGHT! * Sound offsets fixed * added the new anims to implement * new sheet * loopSpin implemented * woah * mis stuff * doen done done * Various fixes * Fixed clappy trio bop bug * Epic tings * Added color and screen shake * Small things * redid sheets a little * Fixed burger preview * Almost done with forklifter * Bg color and fixed 4 peas for fork lifter * icon * bg stuff for tambourine and forklfiter --------- Co-authored-by: ev <85412919+evdial@users.noreply.github.com>
This commit is contained in:
@ -37,6 +37,28 @@ namespace HeavenStudio.Games.Loaders
|
||||
|
||||
function = delegate { Jukebox.PlayOneShot("games/forkLifter/sigh"); }
|
||||
},
|
||||
new GameAction("color", "Background Color")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; ForkLifter.instance.FadeBackgroundColor(e["start"], e["end"], e.length, e["instant"]); },
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("start", Color.white, "Start Color", "The color to start fading from."),
|
||||
new Param("end", Color.white, "End Color", "The color to end the fade."),
|
||||
new Param("instant", false, "Instant", "If checked, the background color will instantly change to the start color.")
|
||||
},
|
||||
resizable = true
|
||||
},
|
||||
new GameAction("colorGrad", "Gradient Color")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; ForkLifter.instance.FadeGradientColor(e["start"], e["end"], e.length, e["instant"]); },
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("start", Color.white, "Start Color", "The color to start fading from."),
|
||||
new Param("end", Color.white, "End Color", "The color to end the fade."),
|
||||
new Param("instant", false, "Instant", "If checked, the gradient color will instantly change to the start color.")
|
||||
},
|
||||
resizable = true
|
||||
},
|
||||
// These are still here for backwards-compatibility but are hidden in the editor
|
||||
new GameAction("pea", "")
|
||||
{
|
||||
@ -92,6 +114,16 @@ namespace HeavenStudio.Games
|
||||
public Animator handAnim;
|
||||
public GameObject flickedObject;
|
||||
public SpriteRenderer peaPreview;
|
||||
[SerializeField] SpriteRenderer bg;
|
||||
[SerializeField] SpriteRenderer bgGradient;
|
||||
[SerializeField] SpriteRenderer viewerCircle;
|
||||
[SerializeField] SpriteRenderer playerShadow;
|
||||
[SerializeField] SpriteRenderer handShadow;
|
||||
Tween bgColorTween;
|
||||
Tween bgGradientColorTween;
|
||||
Tween viewerCircleColorTween;
|
||||
Tween playerShadowColorTween;
|
||||
Tween handShadowColorTween;
|
||||
|
||||
public Sprite[] peaSprites;
|
||||
public Sprite[] peaHitSprites;
|
||||
@ -111,6 +143,7 @@ namespace HeavenStudio.Games
|
||||
{
|
||||
Jukebox.PlayOneShotGame("forkLifter/flick");
|
||||
handAnim.Play("Hand_Flick", 0, 0);
|
||||
ForkLifterHand.currentFlickIndex++;
|
||||
GameObject fo = Instantiate(flickedObject);
|
||||
fo.transform.parent = flickedObject.transform.parent;
|
||||
Pea pea = fo.GetComponent<Pea>();
|
||||
@ -118,6 +151,62 @@ namespace HeavenStudio.Games
|
||||
pea.type = type;
|
||||
fo.SetActive(true);
|
||||
}
|
||||
|
||||
public void ChangeBackgroundColor(Color color, float beats)
|
||||
{
|
||||
var seconds = Conductor.instance.secPerBeat * beats;
|
||||
|
||||
if (bgColorTween != null)
|
||||
bgColorTween.Kill(true);
|
||||
if (viewerCircleColorTween != null)
|
||||
viewerCircleColorTween.Kill(true);
|
||||
if (handShadowColorTween != null) handShadowColorTween.Kill(true);
|
||||
|
||||
if (seconds == 0)
|
||||
{
|
||||
bg.color = color;
|
||||
viewerCircle.color = color;
|
||||
handShadow.color = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
bgColorTween = bg.DOColor(color, seconds);
|
||||
handShadowColorTween = handShadow.DOColor(color, seconds);
|
||||
viewerCircleColorTween = viewerCircle.DOColor(color, seconds);
|
||||
}
|
||||
}
|
||||
|
||||
public void FadeBackgroundColor(Color start, Color end, float beats, bool instant)
|
||||
{
|
||||
ChangeBackgroundColor(start, 0f);
|
||||
if (!instant) ChangeBackgroundColor(end, beats);
|
||||
}
|
||||
|
||||
public void ChangeGradientColor(Color color, float beats)
|
||||
{
|
||||
var seconds = Conductor.instance.secPerBeat * beats;
|
||||
|
||||
if (bgGradientColorTween != null)
|
||||
bgGradientColorTween.Kill(true);
|
||||
if (playerShadowColorTween != null) playerShadowColorTween.Kill(true);
|
||||
|
||||
if (seconds == 0)
|
||||
{
|
||||
bgGradient.color = color;
|
||||
playerShadow.color = color;
|
||||
}
|
||||
else
|
||||
{
|
||||
bgGradientColorTween = bgGradient.DOColor(color, seconds);
|
||||
playerShadowColorTween = playerShadow.DOColor(color, seconds);
|
||||
}
|
||||
}
|
||||
|
||||
public void FadeGradientColor(Color start, Color end, float beats, bool instant)
|
||||
{
|
||||
ChangeGradientColor(start, 0f);
|
||||
if (!instant) ChangeGradientColor(end, beats);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user