Some facial expressions for Karate Man

This commit is contained in:
Braedon 2022-01-26 12:02:44 -05:00
parent 5985e17ad8
commit 8268936e6d
10 changed files with 175 additions and 59 deletions

View File

@ -31,6 +31,88 @@ Transform:
m_Father: {fileID: 4148631055418481416} m_Father: {fileID: 4148631055418481416}
m_RootOrder: 1 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &564650125393930190
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7677199528729525918}
- component: {fileID: 868007046405604311}
m_Layer: 0
m_Name: MissEffect
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &7677199528729525918
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 564650125393930190}
m_LocalRotation: {x: -0, y: -0, z: -0.0016571856, w: 0.9999986}
m_LocalPosition: {x: -3.03, y: 1.8, z: 0}
m_LocalScale: {x: 0.58812755, y: 0.58812755, z: 0.58812755}
m_Children: []
m_Father: {fileID: 7248900333300803150}
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -0.19}
--- !u!212 &868007046405604311
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 564650125393930190}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 60
m_Sprite: {fileID: -348202296468608855, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 5.2222223, y: 3.8888888}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &1174851578296134715 --- !u!1 &1174851578296134715
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -290,6 +372,7 @@ MonoBehaviour:
createBeat: 0 createBeat: 0
isEligible: 0 isEligible: 0
eligibleHitsList: [] eligibleHitsList: []
aceTimes: 0
kicked: 0 kicked: 0
Holder: {fileID: 279641605354570890} Holder: {fileID: 279641605354570890}
RotHolder: {fileID: 7503168023327542540} RotHolder: {fileID: 7503168023327542540}
@ -5712,7 +5795,7 @@ Transform:
m_Children: m_Children:
- {fileID: 8285689916985503547} - {fileID: 8285689916985503547}
m_Father: {fileID: 7248900333300803150} m_Father: {fileID: 7248900333300803150}
m_RootOrder: 11 m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &6693302166145137461 --- !u!1 &6693302166145137461
GameObject: GameObject:
@ -6162,6 +6245,18 @@ MonoBehaviour:
HitParticle: {fileID: 7248900332593533644} HitParticle: {fileID: 7248900332593533644}
RockParticle: {fileID: 7248900332432276694} RockParticle: {fileID: 7248900332432276694}
BulbHit: {fileID: 7248900333007582906} BulbHit: {fileID: 7248900333007582906}
head: {fileID: 7248900332283351264}
heads:
- {fileID: 4149267612586432800, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: 3060967690338004721, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: 4866608027561499029, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: -467025217388406215, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: 2844288917660902187, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: -4811965814584269873, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: -3340168359885296488, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: 3379959602278205485, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: 8497358629359107968, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
missEffect: {fileID: 564650125393930190}
hitBarrel: 0 hitBarrel: 0
currentComboPots: [] currentComboPots: []
comboNormalizedBeat: 0 comboNormalizedBeat: 0
@ -6918,6 +7013,7 @@ MonoBehaviour:
createBeat: 0 createBeat: 0
isEligible: 0 isEligible: 0
eligibleHitsList: [] eligibleHitsList: []
aceTimes: 0
startBeat: 0 startBeat: 0
createBeat: 0 createBeat: 0
anim: {fileID: 0} anim: {fileID: 0}
@ -17638,6 +17734,7 @@ Transform:
- {fileID: 2035530467837460450} - {fileID: 2035530467837460450}
- {fileID: 634606877704519381} - {fileID: 634606877704519381}
- {fileID: 6013960276080899241} - {fileID: 6013960276080899241}
- {fileID: 7677199528729525918}
- {fileID: 7581330309301576633} - {fileID: 7581330309301576633}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0

View File

@ -814,4 +814,11 @@ AnimationClip:
m_EulerEditorCurves: [] m_EulerEditorCurves: []
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events:
- time: 0
functionName: SetHead
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0

View File

@ -1458,4 +1458,11 @@ AnimationClip:
m_EulerEditorCurves: [] m_EulerEditorCurves: []
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events:
- time: 0
functionName: SetHead
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0

View File

@ -218,13 +218,6 @@ AnimationClip:
classID: 1 classID: 1
script: {fileID: 0} script: {fileID: 0}
m_PPtrCurves: m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 8497358629359107968, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
attribute: m_Sprite
path: Head
classID: 212
script: {fileID: 0}
- curve: - curve:
- time: 0 - time: 0
value: {fileID: 5131679410369794127, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} value: {fileID: 5131679410369794127, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
@ -281,13 +274,6 @@ AnimationClip:
typeID: 1 typeID: 1
customType: 0 customType: 0
isPPtrCurve: 0 isPPtrCurve: 0
- serializedVersion: 2
path: 130111906
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
- serializedVersion: 2 - serializedVersion: 2
path: 3561792701 path: 3561792701
attribute: 0 attribute: 0
@ -345,7 +331,6 @@ AnimationClip:
customType: 0 customType: 0
isPPtrCurve: 0 isPPtrCurve: 0
pptrCurveMapping: pptrCurveMapping:
- {fileID: 8497358629359107968, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: 5131679410369794127, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: 5131679410369794127, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: 8943939637534532364, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: 8943939637534532364, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
m_AnimationClipSettings: m_AnimationClipSettings:
@ -818,4 +803,11 @@ AnimationClip:
m_EulerEditorCurves: [] m_EulerEditorCurves: []
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events:
- time: 0
functionName: SetHead
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 8
messageOptions: 0

View File

@ -492,13 +492,6 @@ AnimationClip:
classID: 1 classID: 1
script: {fileID: 0} script: {fileID: 0}
m_PPtrCurves: m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 8497358629359107968, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
attribute: m_Sprite
path: Head
classID: 212
script: {fileID: 0}
- curve: - curve:
- time: 0 - time: 0
value: {fileID: -2636709571086610862, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} value: {fileID: -2636709571086610862, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
@ -671,13 +664,6 @@ AnimationClip:
typeID: 1 typeID: 1
customType: 0 customType: 0
isPPtrCurve: 0 isPPtrCurve: 0
- serializedVersion: 2
path: 130111906
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
- serializedVersion: 2 - serializedVersion: 2
path: 3561792701 path: 3561792701
attribute: 0 attribute: 0
@ -693,7 +679,6 @@ AnimationClip:
customType: 23 customType: 23
isPPtrCurve: 1 isPPtrCurve: 1
pptrCurveMapping: pptrCurveMapping:
- {fileID: 8497358629359107968, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: -2636709571086610862, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: -2636709571086610862, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: 8132349032079424561, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: 8132349032079424561, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
- {fileID: 2873506237420579991, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: 2873506237420579991, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3}
@ -1962,4 +1947,18 @@ AnimationClip:
script: {fileID: 0} script: {fileID: 0}
m_HasGenericRootTransform: 0 m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0 m_HasMotionFloatCurves: 0
m_Events: [] m_Events:
- time: 0
functionName: SetHead
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 8
messageOptions: 0
- time: 0.5
functionName: SetHead
data:
objectReferenceParameter: {fileID: 0}
floatParameter: 0
intParameter: 0
messageOptions: 0

View File

@ -7970,8 +7970,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f86858990a87c764892672104bdaef1f, type: 3} m_Script: {fileID: 11500000, guid: f86858990a87c764892672104bdaef1f, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
level: {fileID: 4900000, guid: fafaeee85f4121643a0699a4de97da53, type: 3} level: {fileID: 4900000, guid: 5e794baa94fb06d4f939aaf032fab5ea, type: 3}
music: {fileID: 8300000, guid: a0589cdba27fb254e90da17b4804c2fe, type: 3} music: {fileID: 8300000, guid: f3b9f9179bad8394a98f617bda265a62, type: 3}
debugUI: 0 debugUI: 0
playOnStart: 0 playOnStart: 0
editor: 1 editor: 1
@ -11111,15 +11111,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a66fbd5ffe9b9d64da304996f1919f40, type: 3} m_Script: {fileID: 11500000, guid: a66fbd5ffe9b9d64da304996f1919f40, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_width: 1920
_height: 1080
_preset: 0
_frameRate: 60
_tempRT: {fileID: 0}
_blitter: {fileID: 0}
_frameCount: 0
_startTime: 0
_frameDropCount: 0
--- !u!114 &2047408678 --- !u!114 &2047408678
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -11132,10 +11123,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e55bddfe16e69224c8c4b4eb165695d4, type: 3} m_Script: {fileID: 11500000, guid: e55bddfe16e69224c8c4b4eb165695d4, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_frameRate: 60
_offlineMode: 1
_originalFrameRate: 0
_originalVSyncCount: 0
--- !u!1 &2066632679 --- !u!1 &2066632679
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -8,31 +8,29 @@ namespace RhythmHeavenMania.Games.KarateMan
{ {
public class KarateJoe : MonoBehaviour public class KarateJoe : MonoBehaviour
{ {
[Header("Components")]
public Animator anim; public Animator anim;
private int currentHitInList = 0;
public GameObject HitEffect; public GameObject HitEffect;
[Header("Particles")]
public ParticleSystem HitParticle; public ParticleSystem HitParticle;
public ParticleSystem RockParticle; public ParticleSystem RockParticle;
public GameObject BulbHit; public GameObject BulbHit;
[SerializeField] private SpriteRenderer head;
[SerializeField] private Sprite[] heads;
[SerializeField] private GameObject missEffect;
[Header("Properties")]
public bool hitBarrel = false; public bool hitBarrel = false;
public Coroutine kickC; public Coroutine kickC;
public Coroutine missC;
private float barrelBeat; private float barrelBeat;
private bool inCombo; private bool inCombo;
private bool hitCombo; private bool hitCombo;
private float comboBeat; private float comboBeat;
public List<Pot> currentComboPots = new List<Pot>(); public List<Pot> currentComboPots = new List<Pot>();
private int comboPotIndex; private int comboPotIndex;
private int currentComboHitInList; private int currentComboHitInList;
private int comboIndex; private int comboIndex;
public float comboNormalizedBeat = 0; public float comboNormalizedBeat = 0;
public static KarateJoe instance { get; set; } public static KarateJoe instance { get; set; }
@ -294,5 +292,21 @@ namespace RhythmHeavenMania.Games.KarateMan
anim.Play(name, 0, 0); anim.Play(name, 0, 0);
anim.speed = 1; anim.speed = 1;
} }
public void SetHead(int index)
{
head.sprite = heads[index];
}
public IEnumerator Miss()
{
// I couldn't find the sound for this
GameObject miss = Instantiate(missEffect, missEffect.transform.parent);
miss.SetActive(true);
SetHead(2);
yield return new WaitForSeconds(0.08f);
Destroy(miss);
SetHead(0);
}
} }
} }

View File

@ -76,6 +76,7 @@ namespace RhythmHeavenMania.Games.KarateMan
GameObject pot = Instantiate(Pot); GameObject pot = Instantiate(Pot);
pot.transform.parent = Pot.transform.parent; pot.transform.parent = Pot.transform.parent;
KarateJoe.instance.SetHead(0);
Pot p = pot.GetComponent<Pot>(); Pot p = pot.GetComponent<Pot>();

View File

@ -49,6 +49,8 @@ namespace RhythmHeavenMania.Games.KarateMan
public Vector2 endShadowThrowPos; public Vector2 endShadowThrowPos;
private int missTimes = 0;
private void Start() private void Start()
{ {
anim = GetComponent<Animator>(); anim = GetComponent<Animator>();
@ -139,6 +141,14 @@ namespace RhythmHeavenMania.Games.KarateMan
lastShadowX = Shadow.transform.localPosition.x; lastShadowX = Shadow.transform.localPosition.x;
lastRot = Holder.transform.GetChild(0).eulerAngles.z; lastRot = Holder.transform.GetChild(0).eulerAngles.z;
if (combo && comboIndex == 0 || combo && comboIndex == 5 || !combo)
if (normalizedBeat >= 2 && missTimes == 0)
{
if (KarateJoe.instance.missC != null) StopCoroutine(KarateJoe.instance.missC);
KarateJoe.instance.missC = KarateJoe.instance.StartCoroutine(KarateJoe.instance.Miss());
missTimes = 1;
}
StateCheck(normalizedBeat); StateCheck(normalizedBeat);
if (!combo) if (!combo)
@ -271,6 +281,8 @@ namespace RhythmHeavenMania.Games.KarateMan
{ {
Jukebox.PlayOneShot("miss"); Jukebox.PlayOneShot("miss");
KarateJoe.instance.SetHead(3);
NewHolder(); NewHolder();
Holder.transform.parent = newHolder.transform; Holder.transform.parent = newHolder.transform;