HeavenStudio/Assets/Scripts/Games/DJSchool/DJYellow.cs
AstrlJelly 11044922d3
Marching Orders Rework + Bug Fixes (#442)
* first things first, kill mr. downbeat.

now onto fixing meat grinder forrealzies

* meat grinder fix

* fixed munchy monk icon + mr upbeat ding bug

* a few little changes

* lotta stuff

yeahh just look at the pr description

* point and clap

* anim Adjustment

* new sheet + adjustments for it

* IM USING THE INTERNET

i hate merge conflicts

* grrr merge conflicts

* insane changes

* progress

* fixed The Spaceball Camera Bug (literally a single line of code wtf guys)
* colrs

* k im done :3

---------

Co-authored-by: ev <85412919+evdial@users.noreply.github.com>
2023-06-04 04:30:42 +00:00

48 lines
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace HeavenStudio.Games.Scripts_DJSchool
{
public class DJYellow : MonoBehaviour
{
public enum DJExpression
{
NeutralLeft = 0,
NeutralRight = 1,
CrossEyed = 2,
Happy = 3,
Focused = 4,
UpFirst = 5,
UpSecond = 6,
}
[SerializeField] List<Sprite> djYellowHeadSprites = new List<Sprite>();
[SerializeField] SpriteRenderer djYellowHeadSprite;
float normalXScale;
float negativeXScale;
void Awake()
{
normalXScale = djYellowHeadSprite.transform.localScale.x;
negativeXScale = -normalXScale;
}
public void ChangeHeadSprite(DJExpression expression)
{
if (expression == DJExpression.UpFirst && HeadSpriteCheck(DJExpression.UpSecond)) return;
djYellowHeadSprite.sprite = djYellowHeadSprites[(int)expression];
}
public bool HeadSpriteCheck(DJExpression expression)
{
return djYellowHeadSprite.sprite == djYellowHeadSprites[(int)expression];
}
public void Reverse(bool should = false)
{
djYellowHeadSprite.transform.localScale = new Vector3(should ? negativeXScale : normalXScale, normalXScale, normalXScale);
}
}
}