mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-29 13:03:05 +00:00
e1f4c0a38d
* Heh * prefab cat * minigame script + sounds imported * more catgrab * oops * functional objects non visual * More cat ghrab 2 * persist/stretchy logs + cue disable sound + sigh * finished cat grab * sdfsdfsdf * oops * Oops. * Freedom * More * more anime * anims almost dune * all anims * Oops. * Fixing bad animation * I have made a severe and continuous lapse in judgement * bear bop + cut + whiff visuals implemented * rest visuals implemented * added log visuals cut * accomadation for persist/stretch * Oops345 * CATS! * sorting layer oops * fix catgrab object being flipped * bug fix and huh choice * sorting layer fix * anim fixes * upscale almost * upscale done * Huge zoom in * left cat put * two main cats done * particles for main logs * Particles implemented * particle tweaks * bg cats placed * bg cats + zoom toggle * slide offset * more bg cat * new object sheet * bg cats final * more particle * particles fr * Oops * catdance update * I have created an Issue * fixed a lot of shit * Paricle fix * particle fix again im sorry * object upscale wip and more * Mistakes * freezer particle and tweaks * resorted * more particle nonsense im sorry everything hurts * freezer break implement * penguin fix * sorry * halves + upscales done + particles done * fixed particles * particle fixes 2000 * fixed cat dance and rest * snow * icon * oops232323 * Sigh * snow implementation * baby done * layering fix * actual layering fix * particle tweaks * windsnowshit * new rotation * rotation pivots set * all particles should be good now * bat fix * bg cats work better * miss implemented * layer arm fix * rotation changed * expose camera ease + spam prevention * it was just 1 beat long * custom objects * custom objects initial implementation * bomb + ball fix * new sounds * oops * More * big ball implementation 2 * Oops. * Update LBJCatMove.cs --------- Co-authored-by: ev <85412919+iloveoatmeal2022@users.noreply.github.com> Co-authored-by: ev <85412919+evdial@users.noreply.github.com>
62 lines
2 KiB
C#
62 lines
2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using HeavenStudio.Util;
|
|
|
|
namespace HeavenStudio.Games.Scripts_LumBEARjack
|
|
{
|
|
public class LBJCatMove : MonoBehaviour
|
|
{
|
|
[Header("Components")]
|
|
[SerializeField] private Transform _otherPoint;
|
|
|
|
[Header("Properties")]
|
|
[SerializeField] private bool _startAtOther;
|
|
[SerializeField] private bool _usePoint = true;
|
|
[SerializeField] private float _slideOffset = 0f;
|
|
|
|
private Vector3 _thisPosition;
|
|
private Vector3 _otherPosition;
|
|
|
|
private Coroutine _currentMove;
|
|
|
|
private void Awake()
|
|
{
|
|
_thisPosition = transform.localPosition;
|
|
if (_usePoint)
|
|
{
|
|
_otherPosition = _otherPoint.localPosition;
|
|
}
|
|
else
|
|
{
|
|
_otherPosition = _thisPosition + new Vector3(_slideOffset / 2, 0);
|
|
}
|
|
if (_startAtOther) transform.localPosition = _otherPosition;
|
|
}
|
|
|
|
public void Move(double beat, double length, bool inToScene)
|
|
{
|
|
if (_currentMove != null) StopCoroutine(_currentMove);
|
|
_currentMove = StartCoroutine(MoveCo(beat, length, inToScene));
|
|
}
|
|
|
|
private IEnumerator MoveCo(double beat, double length, bool inToScene)
|
|
{
|
|
if (length <= 0)
|
|
{
|
|
transform.localPosition = inToScene ? _thisPosition : _otherPosition;
|
|
yield break;
|
|
}
|
|
float normalized = Conductor.instance.GetPositionFromBeat(beat, length, false);
|
|
while (normalized <= 1f)
|
|
{
|
|
normalized = Conductor.instance.GetPositionFromBeat(beat, length);
|
|
Vector3 newPos = Vector3.Lerp(inToScene ? _otherPosition : _thisPosition, inToScene ? _thisPosition : _otherPosition, normalized);
|
|
transform.localPosition = newPos;
|
|
yield return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|