mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 10:47:39 +02:00
Cheer Readers (Just in General) (#328)
* Trying to revive cheer readers * its up to you! * animation time * rah rah sis boom ba boom * position fixes * Ok it's on and other cool stuff * help * lotta stuff * girls * implemented faces * Resetpose * nature is healing * anim fixes * Fixed the lipsync stuff * more lip sync * oops * blushing and lipsync for its up to you * fixes * blush fixes * Fixes with repositioning stuff * Prefab ready for posters * Posters work, look ugly af, but they work * Yay placeholder animation * yay placeholders * fixes * Fixed stuff! Wow epic! * almost all lipsync is in * boom placeholder * Multiple posters * a bunch of girls * Implemented da girls * all anims done * oops * more fixes * Implemented happy faces * oops * Oops2 * made timing of the happy face more accurate * upscaled background * books * Fixed a bug with ok its on * particles for yay * star particle implemented * oops the particle * added another stand * new icon --------- Co-authored-by: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Co-authored-by: ev <85412919+evdial@users.noreply.github.com>
This commit is contained in:
@ -1,28 +1,188 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using HeavenStudio.Util;
|
||||
|
||||
public class RvlCharacter : MonoBehaviour
|
||||
namespace HeavenStudio.Games.Scripts_CheerReaders
|
||||
{
|
||||
[Header("Objects")]
|
||||
public GameObject BaseModel;
|
||||
public Animator BaseAnim;
|
||||
|
||||
public int row;
|
||||
public int col;
|
||||
|
||||
private bool firstCue = true;
|
||||
private bool bookFront = false;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Awake()
|
||||
public class RvlCharacter : MonoBehaviour
|
||||
{
|
||||
BaseAnim = BaseModel.GetComponent<Animator>();
|
||||
}
|
||||
Animator BaseAnim;
|
||||
[SerializeField] Animator faceAnim;
|
||||
[SerializeField] GameObject blushLeft;
|
||||
[SerializeField] GameObject blushRight;
|
||||
public bool bookIsWhite = true;
|
||||
public GameObject posterBook;
|
||||
bool bookIsOpen;
|
||||
bool noBop;
|
||||
bool canOpenBook;
|
||||
public bool player;
|
||||
float currentBlushBeat;
|
||||
bool missed;
|
||||
[SerializeField] bool shouldLookDown;
|
||||
CheerReaders game;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
void Awake()
|
||||
{
|
||||
BaseAnim = GetComponent<Animator>();
|
||||
game = CheerReaders.instance;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
var cond = Conductor.instance;
|
||||
if (cond.isPlaying && !cond.isPaused)
|
||||
{
|
||||
float normalizedBeat = cond.GetPositionFromBeat(currentBlushBeat, 3f);
|
||||
if (normalizedBeat > 1f)
|
||||
{
|
||||
blushLeft.SetActive(false);
|
||||
blushRight.SetActive(false);
|
||||
}
|
||||
if (!game.doingCue && missed)
|
||||
{
|
||||
faceAnim.Play("FaceBlush", 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void HappyFace(bool forceIt = false)
|
||||
{
|
||||
if (game.doingCue && !forceIt) return;
|
||||
faceAnim.Play(player ? "FaceItsOnHappy" : "FaceItsOnNPC", 0, 0);
|
||||
}
|
||||
|
||||
public void Yay()
|
||||
{
|
||||
faceAnim.DoScaledAnimationAsync("FaceYay", 0.5f);
|
||||
BaseAnim.DoScaledAnimationAsync(bookIsWhite ? "WhiteYay" : "BlackYay", 0.5f);
|
||||
}
|
||||
|
||||
public void ResetFace()
|
||||
{
|
||||
if (faceAnim.IsAnimationNotPlaying()) faceAnim.Play("FaceIdle", 0, 0);
|
||||
}
|
||||
|
||||
public void ResetPose()
|
||||
{
|
||||
BaseAnim.Play(bookIsWhite ? "WhiteIdle" : "BlackIdle", 0, 0);
|
||||
ResetFace();
|
||||
}
|
||||
|
||||
public void Boom()
|
||||
{
|
||||
faceAnim.DoScaledAnimationAsync(player ? "FaceBoom" : "FaceBoomNPC", 0.5f);
|
||||
}
|
||||
|
||||
public void ItsUpToYou(int count)
|
||||
{
|
||||
switch (count)
|
||||
{
|
||||
case 1:
|
||||
faceAnim.DoScaledAnimationAsync("FaceIts", 0.5f);
|
||||
break;
|
||||
case 2:
|
||||
faceAnim.DoScaledAnimationAsync("FaceUp", 0.5f);
|
||||
break;
|
||||
case 3:
|
||||
faceAnim.DoScaledAnimationAsync("FaceTo", 0.5f);
|
||||
break;
|
||||
case 4:
|
||||
faceAnim.DoScaledAnimationAsync("FaceYou", 0.5f);
|
||||
break;
|
||||
default:
|
||||
faceAnim.DoScaledAnimationAsync("FaceIts", 0.5f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void OneTwoThree(int count)
|
||||
{
|
||||
switch (count)
|
||||
{
|
||||
case 1:
|
||||
faceAnim.DoScaledAnimationAsync("FaceOne", 0.5f);
|
||||
break;
|
||||
case 2:
|
||||
faceAnim.DoScaledAnimationAsync("FaceTwo", 0.5f);
|
||||
break;
|
||||
case 3:
|
||||
faceAnim.DoScaledAnimationAsync("FaceThree", 0.5f);
|
||||
break;
|
||||
default:
|
||||
faceAnim.DoScaledAnimationAsync("FaceOne", 0.5f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void Bop()
|
||||
{
|
||||
if (noBop) return;
|
||||
if (bookIsOpen)
|
||||
{
|
||||
BaseAnim.DoScaledAnimationAsync(bookIsWhite ? "WhiteBop" : "BlackBop", 0.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseAnim.DoScaledAnimationAsync("Bop", 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
public void Miss()
|
||||
{
|
||||
currentBlushBeat = Conductor.instance.songPositionInBeats;
|
||||
blushLeft.SetActive(true);
|
||||
blushRight.SetActive(true);
|
||||
BaseAnim.Play(bookIsWhite ? "MissWhite" : "MissBlack", 0, 0);
|
||||
noBop = true;
|
||||
missed = true;
|
||||
}
|
||||
|
||||
public void Stare()
|
||||
{
|
||||
faceAnim.Play(shouldLookDown ? "FaceNPCLook2" : "FaceNPCLook1", 0, 0);
|
||||
}
|
||||
|
||||
public void FlipBook(bool hit = true)
|
||||
{
|
||||
posterBook.SetActive(false);
|
||||
if (hit) canOpenBook = false;
|
||||
if (bookIsWhite != game.shouldBeBlack && hit && player)
|
||||
{
|
||||
RepositionBook();
|
||||
return;
|
||||
}
|
||||
BaseAnim.DoScaledAnimationAsync(bookIsWhite ? "WhitetoBlack" : "BlacktoWhite", 0.5f);
|
||||
bookIsWhite = !bookIsWhite;
|
||||
bookIsOpen = true;
|
||||
noBop = false;
|
||||
missed = !hit;
|
||||
}
|
||||
|
||||
public void RepositionBook()
|
||||
{
|
||||
BaseAnim.DoScaledAnimationAsync(bookIsWhite ? "RepositionToWhite" : "RepositionToBlack", 0.5f);
|
||||
bookIsOpen = true;
|
||||
noBop = false;
|
||||
}
|
||||
|
||||
public void StartSpinBook()
|
||||
{
|
||||
posterBook.SetActive(false);
|
||||
canOpenBook = true;
|
||||
BaseAnim.DoScaledAnimationAsync(bookIsWhite ? "SpinfromWhite" : "SpinfromBlack", 0.5f);
|
||||
bookIsOpen = true;
|
||||
noBop = false;
|
||||
}
|
||||
|
||||
public void StopSpinBook()
|
||||
{
|
||||
if (!canOpenBook) return;
|
||||
posterBook.SetActive(true);
|
||||
BaseAnim.DoScaledAnimationAsync("OpenBook", 0.5f);
|
||||
bookIsOpen = true;
|
||||
noBop = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user