mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-27 12:03:00 +00:00
49 lines
No EOL
1.2 KiB
C#
49 lines
No EOL
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
using RhythmHeavenMania.Util;
|
|
|
|
using DG.Tweening;
|
|
|
|
namespace RhythmHeavenMania.Games.ForkLifter
|
|
{
|
|
public class ForkLifter : Minigame
|
|
{
|
|
public static ForkLifter instance;
|
|
|
|
[Header("References")]
|
|
public ForkLifterHand ForkLifterHand;
|
|
|
|
[Header("Objects")]
|
|
public Animator handAnim;
|
|
public GameObject flickedObject;
|
|
public SpriteRenderer peaPreview;
|
|
|
|
public Sprite[] peaSprites;
|
|
public Sprite[] peaHitSprites;
|
|
|
|
private void Awake()
|
|
{
|
|
instance = this;
|
|
}
|
|
|
|
public override void OnGameSwitch()
|
|
{
|
|
ForkLifterHand.CheckNextFlick();
|
|
}
|
|
|
|
public void Flick(float beat, int type)
|
|
{
|
|
Jukebox.PlayOneShotGame("forkLifter/flick");
|
|
handAnim.Play("Hand_Flick", 0, 0);
|
|
GameObject fo = Instantiate(flickedObject);
|
|
fo.transform.parent = flickedObject.transform.parent;
|
|
Pea pea = fo.GetComponent<Pea>();
|
|
pea.startBeat = beat;
|
|
pea.type = type;
|
|
fo.SetActive(true);
|
|
}
|
|
}
|
|
|
|
} |