mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 19:37:39 +02:00
Dj School Rework (#334)
* dj school rework * ASSET BUNDLES fdgdfgfgfgfgfgfgggggggg * more stuff * Animation scaling * gave dj yellow a script * DJ yellow now gets his head sprite changed through script again * turntable Hold animations now play * Force hold added * all sprites and anims done * tweaks * The expressions should be good now * Added bop parity to dj school and fixed a small bug * changes * Fixed bugs with the heads being funny * Added boo and cheer * Boo improvements * new icon --------- Co-authored-by: Rapandrasmus <78219215+Rapandrasmus@users.noreply.github.com> Co-authored-by: minenice55 <star.elementa@gmail.com>
This commit is contained in:
54
Assets/Scripts/Games/DJSchool/DJYellow.cs
Normal file
54
Assets/Scripts/Games/DJSchool/DJYellow.cs
Normal file
@ -0,0 +1,54 @@
|
||||
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 djYellowHeadSrpite;
|
||||
float normalXScale;
|
||||
float negativeXScale;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
normalXScale = djYellowHeadSrpite.transform.localScale.x;
|
||||
negativeXScale = -normalXScale;
|
||||
}
|
||||
|
||||
public void ChangeHeadSprite(DJExpression expression)
|
||||
{
|
||||
if (expression == DJExpression.UpFirst && HeadSpriteCheck(DJExpression.UpSecond)) return;
|
||||
djYellowHeadSrpite.sprite = djYellowHeadSprites[(int)expression];
|
||||
}
|
||||
|
||||
public bool HeadSpriteCheck(DJExpression expression)
|
||||
{
|
||||
return djYellowHeadSrpite.sprite == djYellowHeadSprites[(int)expression];
|
||||
}
|
||||
|
||||
public void Reverse(bool should = false)
|
||||
{
|
||||
if (should)
|
||||
{
|
||||
djYellowHeadSrpite.transform.localScale = new Vector3(negativeXScale, normalXScale, normalXScale);
|
||||
}
|
||||
else
|
||||
{
|
||||
djYellowHeadSrpite.transform.localScale = new Vector3(normalXScale, normalXScale, normalXScale);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user