49 lines
1.0 KiB
C#
49 lines
1.0 KiB
C#
|
|
using System;
|
||
|
|
using System.Diagnostics;
|
||
|
|
using Pixelplacement;
|
||
|
|
using Pixelplacement.TweenSystem;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
public class WolterStateMachine : MonoBehaviour
|
||
|
|
{
|
||
|
|
public Spline jumpSpline;
|
||
|
|
public Transform wolterGameObject;
|
||
|
|
public float jumpDuration;
|
||
|
|
public float jumpDelay;
|
||
|
|
private Animator animator;
|
||
|
|
private TweenBase jumpTween;
|
||
|
|
|
||
|
|
private void Awake()
|
||
|
|
{
|
||
|
|
animator = GetComponentInChildren<Animator>();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||
|
|
void Start()
|
||
|
|
{
|
||
|
|
jumpTween = Tween.Spline(jumpSpline, wolterGameObject, 1, 0, false, jumpDuration, jumpDelay, Tween.EaseInOut, Tween.LoopType.None, HandleJumpStarted, HandleJumpFinished);
|
||
|
|
}
|
||
|
|
|
||
|
|
void HandleJumpStarted()
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
void HandleJumpFinished()
|
||
|
|
{
|
||
|
|
|
||
|
|
if (animator != null)
|
||
|
|
{
|
||
|
|
animator.SetBool("Landed", true);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
// Update is called once per frame
|
||
|
|
void Update()
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|