2021-12-21 01:10:49 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using UnityEngine;
|
|
|
|
|
2022-03-14 14:21:05 +00:00
|
|
|
using HeavenStudio.Util;
|
2023-06-10 19:13:29 +00:00
|
|
|
using Jukebox;
|
|
|
|
using Jukebox.Legacy;
|
2021-12-21 01:10:49 +00:00
|
|
|
|
2022-03-14 14:21:05 +00:00
|
|
|
namespace HeavenStudio.Games.Scripts_ForkLifter
|
2021-12-21 01:10:49 +00:00
|
|
|
{
|
|
|
|
public class ForkLifterHand : MonoBehaviour
|
|
|
|
{
|
|
|
|
public SpriteRenderer fastSprite;
|
|
|
|
|
|
|
|
public Sprite[] fastSprites;
|
|
|
|
|
2023-10-27 20:19:11 +00:00
|
|
|
public List<RiqEntity> allFlickEntities = new List<RiqEntity>();
|
2023-04-23 20:17:21 +00:00
|
|
|
|
|
|
|
public int currentFlickIndex;
|
|
|
|
|
2023-10-27 20:19:11 +00:00
|
|
|
ForkLifter game;
|
|
|
|
|
2023-04-23 20:17:21 +00:00
|
|
|
private void Awake()
|
2021-12-21 01:10:49 +00:00
|
|
|
{
|
2023-10-27 20:19:11 +00:00
|
|
|
game = ForkLifter.instance;
|
2023-04-23 20:17:21 +00:00
|
|
|
}
|
2021-12-21 01:10:49 +00:00
|
|
|
|
2023-04-23 20:17:21 +00:00
|
|
|
public void CheckNextFlick()
|
|
|
|
{
|
|
|
|
if (allFlickEntities.Count > 0 && currentFlickIndex >= 0 && currentFlickIndex < allFlickEntities.Count)
|
2021-12-21 01:10:49 +00:00
|
|
|
{
|
2023-10-27 20:19:11 +00:00
|
|
|
int nextType = allFlickEntities[currentFlickIndex]["type"];
|
|
|
|
game.peaPreview.sprite = game.peaSprites[nextType];
|
|
|
|
fastSprite.sprite = fastSprites[nextType == (int)ForkLifter.FlickType.Burger ? 1 : 0];
|
|
|
|
} else {
|
|
|
|
game.peaPreview.sprite = null;
|
2023-04-23 20:17:21 +00:00
|
|
|
}
|
2021-12-21 01:10:49 +00:00
|
|
|
}
|
|
|
|
|
2023-10-27 20:19:11 +00:00
|
|
|
public void Prepare(bool mute)
|
2021-12-21 01:10:49 +00:00
|
|
|
{
|
2023-10-27 20:19:11 +00:00
|
|
|
if (!mute) SoundByte.PlayOneShotGame("forkLifter/flickPrepare");
|
2021-12-26 01:04:23 +00:00
|
|
|
GetComponent<Animator>().Play("Hand_Prepare", 0, 0);
|
2021-12-21 01:10:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|