HeavenStudioPlus/Assets/Scripts/Games/FirstContact/Translator.cs
minenice55 63a2814caa Timekeeping Improvements and Small Optimizations (#544)
* make BeatActions coroutines instead of componentrs

* pooled scheduled sounds

implement S' entity seek

* remove debug prints from last two changes

* implement absolute time tracking

implement DSP time resyncing

* optimize GameManager

* update TMPro

* update IDE packages

* fix dsp sync making the drift worse

* fix issue with the JSL dll

* relocate debug print

* make scheduled pitch setter functional

* any cpu
2023-09-11 22:28:04 +00:00

67 lines
1.7 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using HeavenStudio.Util;
using Starpelly;
namespace HeavenStudio.Games.Scripts_FirstContact
{
public class Translator : MonoBehaviour
{
public Animator anim;
FirstContact game;
public void Init()
{
game = FirstContact.instance;
//anim = GetComponent<Animator>();
}
private void Update()
{
////IF YOU WANT TO PLAY NOTES ANYTIME W/O CONSTRAINTS
//if (PlayerInput.Pressed(true) && !game.isSpeaking)
//{
// successTranslation(true);
//}
}
public void SuccessTranslation(bool ace)
{
if (ace)
{
//if(game.version == 1)
//{
// Jukebox.PlayOneShotGame("firstContact/citrusRemix/1_r");
//}
SoundByte.PlayOneShotGame("firstContact/" + RandomizerLines());
}
else
{
SoundByte.PlayOneShotGame("firstContact/failContact");
}
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(.5f, delegate { anim.Play("translator_speak", 0, 0);}),
});
}
public void EhTranslation()
{
SoundByte.PlayOneShotGame("firstContact/slightlyFail");
BeatAction.New(this, new List<BeatAction.Action>()
{
new BeatAction.Action(.5f, delegate { anim.Play("translator_eh", 0, 0);}),
});
}
public int RandomizerLines()
{
return Random.Range(1, 11);
}
}
}