mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 11:45:09 +00:00
44 lines
1 KiB
C#
44 lines
1 KiB
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
using RhythmHeavenMania.Util;
|
||
|
|
||
|
namespace RhythmHeavenMania.Games.ForkLifter
|
||
|
{
|
||
|
public class ForkLifter : MonoBehaviour
|
||
|
{
|
||
|
public static ForkLifter instance;
|
||
|
|
||
|
GameManager GameManager;
|
||
|
|
||
|
[Header("Objects")]
|
||
|
public Animator handAnim;
|
||
|
public GameObject flickedObject;
|
||
|
public SpriteRenderer peaPreview;
|
||
|
|
||
|
public Sprite[] peaSprites;
|
||
|
public Sprite[] peaHitSprites;
|
||
|
|
||
|
private void Awake()
|
||
|
{
|
||
|
instance = this;
|
||
|
}
|
||
|
|
||
|
private void Start()
|
||
|
{
|
||
|
GameManager = GameManager.instance;
|
||
|
}
|
||
|
|
||
|
public void Flick(float beat, int type)
|
||
|
{
|
||
|
Jukebox.PlayOneShot("flick");
|
||
|
handAnim.Play("Hand_Flick", 0, 0);
|
||
|
GameObject fo = Instantiate(flickedObject);
|
||
|
fo.GetComponent<Pea>().startBeat = beat;
|
||
|
fo.GetComponent<Pea>().type = type;
|
||
|
fo.SetActive(true);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|