Compare commits

..

2 Commits

Author SHA1 Message Date
77ba7ec9c6 Fixed ghost blink 2026-06-19 12:53:58 +02:00
46e1207c37 Fixed death animation 2026-06-19 12:48:04 +02:00
4 changed files with 99 additions and 23 deletions

View File

@@ -10,7 +10,8 @@ AnimatorState:
m_Name: PacMan m_Name: PacMan
m_Speed: 1 m_Speed: 1
m_CycleOffset: 0 m_CycleOffset: 0
m_Transitions: [] m_Transitions:
- {fileID: -4194104563410422136}
m_StateMachineBehaviours: [] m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0} m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0 m_IKOnFeet: 0
@@ -26,6 +27,58 @@ AnimatorState:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter:
--- !u!1102 &-6650627269168583366
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PacManDead
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 3269978377910821223}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 60532b76a26184441b2940a09b1bc07e, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &-4194104563410422136
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 3
m_ConditionEvent: State
m_EventTreshold: 3
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -6650627269168583366}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.21924293
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!206 &-2066582439274221996 --- !u!206 &-2066582439274221996
BlendTree: BlendTree:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@@ -59,7 +112,7 @@ BlendTree:
m_DirectBlendParameter: State m_DirectBlendParameter: State
m_Mirror: 0 m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: 60532b76a26184441b2940a09b1bc07e, type: 2} m_Motion: {fileID: 7400000, guid: a28e7bee3098d0a4996a108a60ccf4c0, type: 2}
m_Threshold: 3 m_Threshold: 3
m_Position: {x: 0, y: 0} m_Position: {x: 0, y: 0}
m_TimeScale: 1 m_TimeScale: 1
@@ -67,7 +120,7 @@ BlendTree:
m_DirectBlendParameter: State m_DirectBlendParameter: State
m_Mirror: 0 m_Mirror: 0
- serializedVersion: 2 - serializedVersion: 2
m_Motion: {fileID: 7400000, guid: a28e7bee3098d0a4996a108a60ccf4c0, type: 2} m_Motion: {fileID: 7400000, guid: 60532b76a26184441b2940a09b1bc07e, type: 2}
m_Threshold: 4 m_Threshold: 4
m_Position: {x: 0, y: 0} m_Position: {x: 0, y: 0}
m_TimeScale: 1 m_TimeScale: 1
@@ -142,13 +195,13 @@ AnimatorController:
m_DefaultFloat: 0 m_DefaultFloat: 0
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 0} m_Controller: {fileID: 9100000}
- m_Name: Direction - m_Name: Direction
m_Type: 1 m_Type: 1
m_DefaultFloat: 0 m_DefaultFloat: 0
m_DefaultInt: 0 m_DefaultInt: 0
m_DefaultBool: 0 m_DefaultBool: 0
m_Controller: {fileID: 0} m_Controller: {fileID: 9100000}
m_AnimatorLayers: m_AnimatorLayers:
- serializedVersion: 5 - serializedVersion: 5
m_Name: Base Layer m_Name: Base Layer
@@ -162,6 +215,31 @@ AnimatorController:
m_IKPass: 0 m_IKPass: 0
m_SyncedLayerAffectsTiming: 0 m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000} m_Controller: {fileID: 9100000}
--- !u!1101 &3269978377910821223
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 4
m_ConditionEvent: State
m_EventTreshold: 4
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -6692956035035760530}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.8611111
m_HasExitTime: 0
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!206 &6902226148018916867 --- !u!206 &6902226148018916867
BlendTree: BlendTree:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@@ -221,6 +299,9 @@ AnimatorStateMachine:
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: -6692956035035760530} m_State: {fileID: -6692956035035760530}
m_Position: {x: 420, y: 70, z: 0} m_Position: {x: 420, y: 70, z: 0}
- serializedVersion: 1
m_State: {fileID: -6650627269168583366}
m_Position: {x: 441.02686, y: 229.12329, z: 0}
m_ChildStateMachines: [] m_ChildStateMachines: []
m_AnyStateTransitions: [] m_AnyStateTransitions: []
m_EntryTransitions: [] m_EntryTransitions: []

View File

@@ -501,12 +501,7 @@ namespace Marro.PacManUdon
{ {
SetAnimatorGhostType((int)PacManGhostType.Special); SetAnimatorGhostType((int)PacManGhostType.Special);
} }
else if (isScared) else if (!isScared)
{
SetAnimatorGhostType((int)PacManGhostType.Scared);
}
else
{ {
switch (ghostState) switch (ghostState)
{ {

View File

@@ -94,7 +94,7 @@ namespace Marro.PacManUdon
SetSharedPelletCounterActive(true); SetSharedPelletCounterActive(true);
} }
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
ghost.Reset(); ghost.Reset();
} }
@@ -176,7 +176,7 @@ namespace Marro.PacManUdon
for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++) for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++)
{ {
Ghost ghost = ghosts[ghostIndex]; var ghost = ghosts[ghostIndex];
if (ghost.GetGhostState() == PacManGhostState.Home) if (ghost.GetGhostState() == PacManGhostState.Home)
{ {
ghost.Release(); ghost.Release();
@@ -277,7 +277,7 @@ namespace Marro.PacManUdon
void SetGhostBlinkingState(bool white) void SetGhostBlinkingState(bool white)
{ {
blinkCurrentlyWhite = white; blinkCurrentlyWhite = white;
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
ghost.SetWhite(white); ghost.SetWhite(white);
} }
@@ -292,7 +292,7 @@ namespace Marro.PacManUdon
powerPelletCountdown = powerPelletDuration; powerPelletCountdown = powerPelletDuration;
powerPelletMultiplier = 0; powerPelletMultiplier = 0;
SetGhostBlinking(false); SetGhostBlinking(false);
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
ghost.BecomeScared(); ghost.BecomeScared();
} }
@@ -310,7 +310,7 @@ namespace Marro.PacManUdon
public void SetFrozen(bool frozen, bool ignoreIfCaught = false) public void SetFrozen(bool frozen, bool ignoreIfCaught = false)
{ {
this.frozen = frozen; this.frozen = frozen;
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
ghost.SetFrozen(frozen, ignoreIfCaught: ignoreIfCaught); ghost.SetFrozen(frozen, ignoreIfCaught: ignoreIfCaught);
} }
@@ -380,7 +380,7 @@ namespace Marro.PacManUdon
void SetScattering(bool scattering, bool reverseDirection = true) void SetScattering(bool scattering, bool reverseDirection = true)
{ {
//Debug.Log($"{gameObject} SetScattering: {scattering}"); //Debug.Log($"{gameObject} SetScattering: {scattering}");
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
if (ghost == blinky && elroyLevel > 0) // Once blinky is elroy he no longer scatters if (ghost == blinky && elroyLevel > 0) // Once blinky is elroy he no longer scatters
{ {
@@ -398,7 +398,7 @@ namespace Marro.PacManUdon
{ {
//Debug.Log($"{gameObject} SetSharedPelletCounterActive {active}"); //Debug.Log($"{gameObject} SetSharedPelletCounterActive {active}");
sharedPelletCounterActive = active; sharedPelletCounterActive = active;
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
ghost.SetHousePelletCounterActive(!active); ghost.SetHousePelletCounterActive(!active);
} }
@@ -426,7 +426,7 @@ namespace Marro.PacManUdon
//Debug.Log($"Incremented shared pellet counter to {sharedPelletCounter}"); //Debug.Log($"Incremented shared pellet counter to {sharedPelletCounter}");
for (int ghostIndex = 0; ghostIndex < sharedPelletCounterReleaseValues.Length; ghostIndex++) for (int ghostIndex = 0; ghostIndex < sharedPelletCounterReleaseValues.Length; ghostIndex++)
{ {
Ghost ghost = ghosts[ghostIndex]; var ghost = ghosts[ghostIndex];
if (ghost.GetGhostState() == PacManGhostState.Home && sharedPelletCounter == sharedPelletCounterReleaseValues[ghostIndex]) if (ghost.GetGhostState() == PacManGhostState.Home && sharedPelletCounter == sharedPelletCounterReleaseValues[ghostIndex])
{ {
ghost.Release(); ghost.Release();
@@ -443,7 +443,7 @@ namespace Marro.PacManUdon
{ {
for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++) for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++)
{ {
Ghost ghost = ghosts[ghostIndex]; var ghost = ghosts[ghostIndex];
if (ghost.GetGhostState() == PacManGhostState.Home) if (ghost.GetGhostState() == PacManGhostState.Home)
{ {
ghost.IncrementHousePelletCounter(); ghost.IncrementHousePelletCounter();
@@ -470,7 +470,7 @@ namespace Marro.PacManUdon
public void SetActive(bool active) public void SetActive(bool active)
{ {
gameObject.SetActive(active); gameObject.SetActive(active);
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
ghost.SetActive(active); ghost.SetActive(active);
} }
@@ -479,7 +479,7 @@ namespace Marro.PacManUdon
public void SetKinematic(bool kinematic) public void SetKinematic(bool kinematic)
{ {
this.kinematic = kinematic; this.kinematic = kinematic;
foreach (Ghost ghost in ghosts) foreach (var ghost in ghosts)
{ {
ghost.SetKinematic(kinematic); ghost.SetKinematic(kinematic);
} }

View File

@@ -8,8 +8,8 @@ namespace Marro.PacManUdon
Idle, Idle,
Moving, Moving,
Stopped, Stopped,
Big,
Dead, Dead,
Big
} }
[RequireComponent(typeof(Animator))] [RequireComponent(typeof(Animator))]