mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 19:57:38 +02:00
Karate Man started.
This commit is contained in:
34
Assets/Scripts/Games/KarateMan/Pot.cs
Normal file
34
Assets/Scripts/Games/KarateMan/Pot.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RhythmHeavenMania.Games.KarateMan
|
||||
{
|
||||
public class Pot : PlayerActionObject
|
||||
{
|
||||
public float startBeat;
|
||||
private Animator anim;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject Sprite;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
PlayerActionInit(this.gameObject);
|
||||
anim = GetComponent<Animator>();
|
||||
|
||||
Sprite.transform.eulerAngles = new Vector3(0, 0, Random.Range(0, 360));
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
float normalizedBeatAnim = Conductor.instance.GetLoopPositionFromBeat(startBeat, 2.15f);
|
||||
anim.Play("PotThrow", 0, normalizedBeatAnim);
|
||||
anim.speed = 0;
|
||||
|
||||
float normalizedBeat = Conductor.instance.GetLoopPositionFromBeat(startBeat, 1);
|
||||
|
||||
StateCheck(normalizedBeat, KarateMan.instance.EligibleHits);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user