mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-12-01 22:07:31 +00:00
00c58d5487
* Prep stuff * Tweezers now spawn in * Started converting tweezers * I hate <1 beat intervals * Actually nvm * fixed a bug * You can chain intervals now, stack them if you really wanted * Pass turn checks if crhandlerinstance exists * Fixed hairs being deleted by onion switch * Rockers rerewritten * working dough rerewritten
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using NaughtyBezierCurves;
|
|
using HeavenStudio.Util;
|
|
|
|
namespace HeavenStudio.Games.Scripts_WorkingDough
|
|
{
|
|
public class NPCDoughBall : SuperCurveObject
|
|
{
|
|
private double startBeat = double.MinValue;
|
|
private Path path;
|
|
[SerializeField] private GameObject gandw;
|
|
|
|
public void Init(double beat, bool hasGandw)
|
|
{
|
|
startBeat = beat;
|
|
path = WorkingDough.instance.GetPath("NPCBall");
|
|
if (gandw != null) gandw.SetActive(hasGandw);
|
|
Update();
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
var cond = Conductor.instance;
|
|
|
|
if (cond.isPlaying && !cond.isPaused)
|
|
{
|
|
double beat = cond.songPositionInBeats;
|
|
if (startBeat > double.MinValue)
|
|
{
|
|
Vector3 pos = GetPathPositionFromBeat(path, Math.Max(beat, startBeat), startBeat);
|
|
if (startBeat <= beat) transform.position = pos;
|
|
else transform.position = new Vector3(-80, -80);
|
|
if (beat >= startBeat + 2) Destroy(gameObject);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|