2022-05-16 05:29:26 +00:00
|
|
|
using DG.Tweening;
|
|
|
|
using NaughtyBezierCurves;
|
|
|
|
using HeavenStudio.Util;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
2023-01-14 04:53:25 +00:00
|
|
|
using UnityEngine.Rendering;
|
2022-05-16 05:29:26 +00:00
|
|
|
|
|
|
|
namespace HeavenStudio.Games.Scripts_NtrSamurai
|
|
|
|
{
|
|
|
|
public class NtrSamuraiChild : MonoBehaviour
|
|
|
|
{
|
|
|
|
[Header("Transforms")]
|
|
|
|
public Transform DebrisPosL;
|
|
|
|
public Transform DebrisPosR;
|
|
|
|
public Transform WalkPos0;
|
|
|
|
public Transform WalkPos1;
|
|
|
|
|
|
|
|
[Header("Objects")]
|
|
|
|
public Animator anim;
|
|
|
|
|
2023-06-10 19:17:06 +00:00
|
|
|
public double startBeat = double.MinValue;
|
2022-05-16 05:29:26 +00:00
|
|
|
public bool isMain = true;
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
void Update()
|
|
|
|
{
|
|
|
|
if (!isMain)
|
|
|
|
{
|
|
|
|
var cond = Conductor.instance;
|
2023-01-14 04:53:25 +00:00
|
|
|
float prog = Conductor.instance.GetPositionFromBeat(startBeat + 1f, 4f);
|
2022-05-16 05:29:26 +00:00
|
|
|
if (prog >= 0)
|
|
|
|
{
|
|
|
|
Walk();
|
|
|
|
transform.position = Vector3.Lerp(WalkPos0.position, WalkPos1.position, prog);
|
|
|
|
if (prog >= 1f)
|
|
|
|
{
|
|
|
|
GameObject.Destroy(gameObject);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Bop()
|
|
|
|
{
|
|
|
|
anim.Play("ChildBeat", -1, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Walk()
|
|
|
|
{
|
|
|
|
anim.Play("ChildWalk");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|