2021-12-21 01:10:49 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
using RhythmHeavenMania.Util;
|
|
|
|
|
2021-12-23 00:08:35 +00:00
|
|
|
using DG.Tweening;
|
|
|
|
|
2021-12-21 01:10:49 +00:00
|
|
|
namespace RhythmHeavenMania.Games.ForkLifter
|
|
|
|
{
|
2021-12-24 03:36:16 +00:00
|
|
|
public class ForkLifter : Minigame
|
2021-12-21 01:10:49 +00:00
|
|
|
{
|
|
|
|
public static ForkLifter instance;
|
|
|
|
|
2021-12-23 00:08:35 +00:00
|
|
|
[Header("References")]
|
|
|
|
public ForkLifterHand ForkLifterHand;
|
2021-12-21 04:38:59 +00:00
|
|
|
|
2021-12-21 01:10:49 +00:00
|
|
|
[Header("Objects")]
|
|
|
|
public Animator handAnim;
|
|
|
|
public GameObject flickedObject;
|
|
|
|
public SpriteRenderer peaPreview;
|
|
|
|
|
|
|
|
public Sprite[] peaSprites;
|
|
|
|
public Sprite[] peaHitSprites;
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
{
|
|
|
|
instance = this;
|
|
|
|
}
|
|
|
|
|
2021-12-24 03:36:16 +00:00
|
|
|
public override void OnGameSwitch()
|
|
|
|
{
|
|
|
|
ForkLifterHand.CheckNextFlick();
|
|
|
|
}
|
|
|
|
|
2021-12-21 01:10:49 +00:00
|
|
|
public void Flick(float beat, int type)
|
|
|
|
{
|
2021-12-23 22:39:03 +00:00
|
|
|
Jukebox.PlayOneShotGame("forkLifter/flick");
|
2021-12-21 01:10:49 +00:00
|
|
|
handAnim.Play("Hand_Flick", 0, 0);
|
|
|
|
GameObject fo = Instantiate(flickedObject);
|
2021-12-25 12:16:40 +00:00
|
|
|
fo.transform.parent = flickedObject.transform.parent;
|
2022-02-03 22:20:26 +00:00
|
|
|
Pea pea = fo.GetComponent<Pea>();
|
|
|
|
pea.startBeat = beat;
|
|
|
|
pea.type = type;
|
2021-12-21 01:10:49 +00:00
|
|
|
fo.SetActive(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|