Simplified ghost starting direction logic
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -43,7 +43,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 44
|
||||
Data: 43
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@@ -1771,13 +1771,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: faceInStartingDirectionUntilUnfrozen
|
||||
Data: kinematic
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 91|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: faceInStartingDirectionUntilUnfrozen
|
||||
Data: kinematic
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 62
|
||||
@@ -1819,13 +1819,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: kinematic
|
||||
Data: specialLook
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 93|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: kinematic
|
||||
Data: specialLook
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 62
|
||||
@@ -1867,13 +1867,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: specialLook
|
||||
Data: followingPredefinedPath
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 95|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: specialLook
|
||||
Data: followingPredefinedPath
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 62
|
||||
@@ -1915,19 +1915,31 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: followingPredefinedPath
|
||||
Data: predefinedPath
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 97|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: followingPredefinedPath
|
||||
Data: predefinedPath
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 62
|
||||
Entry: 7
|
||||
Data: 98|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.Direction[], Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 62
|
||||
Entry: 7
|
||||
Data: 99|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Int32[], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1942,7 +1954,8 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 98|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 100|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
||||
mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1963,31 +1976,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: predefinedPath
|
||||
Data: predefinedPathIndex
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 99|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 101|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: predefinedPath
|
||||
Data: predefinedPathIndex
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 100|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.Direction[], Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 101|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Int32[], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -2024,13 +2025,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: predefinedPathIndex
|
||||
Data: <Index>k__BackingField
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 103|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: predefinedPathIndex
|
||||
Data: <Index>k__BackingField
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
@@ -2073,13 +2074,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: <Index>k__BackingField
|
||||
Data: animatorKeyDirection
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 105|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: <Index>k__BackingField
|
||||
Data: animatorKeyDirection
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
@@ -2122,13 +2123,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: animatorKeyDirection
|
||||
Data: animatorKeyGhostType
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 107|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: animatorKeyDirection
|
||||
Data: animatorKeyGhostType
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
@@ -2171,19 +2172,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: animatorKeyGhostType
|
||||
Data: cardinalDirections
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 109|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: animatorKeyGhostType
|
||||
Data: cardinalDirections
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
Data: 98
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
Data: 99
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -2220,19 +2221,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: cardinalDirections
|
||||
Data: horizontalDirections
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 111|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: cardinalDirections
|
||||
Data: horizontalDirections
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 100
|
||||
Data: 98
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 101
|
||||
Data: 99
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -2264,55 +2265,6 @@ MonoBehaviour:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: horizontalDirections
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 113|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: horizontalDirections
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 100
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 101
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 114|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
||||
mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
|
||||
@@ -76,7 +76,6 @@ namespace Marro.PacManUdon
|
||||
private int housePelletCounter;
|
||||
private bool housePelletCounterActive;
|
||||
private int housePelletCounterLimit;
|
||||
private bool faceInStartingDirectionUntilUnfrozen;
|
||||
|
||||
// Cutscene
|
||||
private bool kinematic;
|
||||
@@ -133,6 +132,11 @@ namespace Marro.PacManUdon
|
||||
if (startState == PacManGhostStartState.TargetingIdlePosition1)
|
||||
{
|
||||
SetOffGridTarget(idlePosition1, false);
|
||||
SetTargetDirection(Direction.Up);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetTargetDirection(Direction.Down);
|
||||
}
|
||||
ghostState = PacManGhostState.Entering;
|
||||
OffGridTargetReached();
|
||||
@@ -148,7 +152,6 @@ namespace Marro.PacManUdon
|
||||
rngState = 1;
|
||||
UpdateSpeed();
|
||||
|
||||
faceInStartingDirectionUntilUnfrozen = true;
|
||||
UpdateAnimator();
|
||||
|
||||
// Debug.Log($"{gameObject} reset with state: {state}, target: {target}, offGrid: {offGrid}");
|
||||
@@ -519,15 +522,7 @@ namespace Marro.PacManUdon
|
||||
}
|
||||
}
|
||||
|
||||
if (faceInStartingDirectionUntilUnfrozen && startState == PacManGhostStartState.TargetingIdlePosition1)
|
||||
{
|
||||
SetAnimatorDirection((int)Direction.Up);
|
||||
}
|
||||
else if (faceInStartingDirectionUntilUnfrozen && startState == PacManGhostStartState.TargetingIdlePosition2)
|
||||
{
|
||||
SetAnimatorDirection((int)Direction.Down);
|
||||
}
|
||||
else if (specialLook || targetDirection != Direction.Zero)
|
||||
if (specialLook || targetDirection != Direction.Zero)
|
||||
{
|
||||
SetAnimatorDirection((int)targetDirection);
|
||||
}
|
||||
@@ -680,12 +675,6 @@ namespace Marro.PacManUdon
|
||||
frozenState = PacManGhostFrozenState.NotFrozen;
|
||||
}
|
||||
animator.speed = frozen && !keepAnimating ? 0 : 1; // This would cause issues if the returning sprite was animated, luckily it isn't :)
|
||||
|
||||
if (frozen == false && faceInStartingDirectionUntilUnfrozen)
|
||||
{
|
||||
faceInStartingDirectionUntilUnfrozen = false;
|
||||
UpdateAnimator();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetHousePelletCounterActive(bool active)
|
||||
@@ -789,7 +778,6 @@ namespace Marro.PacManUdon
|
||||
data.AppendAsByte(housePelletCounter, ref index);
|
||||
data.Append(housePelletCounterActive, ref index);
|
||||
data.AppendAsByte(housePelletCounterLimit, ref index);
|
||||
data.Append(faceInStartingDirectionUntilUnfrozen, ref index);
|
||||
|
||||
base.CollectSyncedData(data, ref index, eventType);
|
||||
}
|
||||
@@ -817,7 +805,6 @@ namespace Marro.PacManUdon
|
||||
housePelletCounter = data.ReadByte(ref index);
|
||||
housePelletCounterActive = data.ReadBool(ref index);
|
||||
housePelletCounterLimit = data.ReadByte(ref index);
|
||||
faceInStartingDirectionUntilUnfrozen = data.ReadBool(ref index);
|
||||
|
||||
return base.WriteSyncedData(data, ref index, eventType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user