Compare commits
2 Commits
cb975c24b2
...
ca116ac77f
| Author | SHA1 | Date | |
|---|---|---|---|
| ca116ac77f | |||
| e431dab042 |
@@ -43,7 +43,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 16
|
||||
Data: 17
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@@ -890,6 +890,54 @@ MonoBehaviour:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: frozen
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: frozen
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 26
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 26
|
||||
- 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: 48|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:
|
||||
|
||||
@@ -38,6 +38,8 @@ namespace Marro.PacManUdon
|
||||
private int[] ghostPositions = new int[4];
|
||||
private int pacManPosition;
|
||||
|
||||
private bool frozen;
|
||||
|
||||
public void Initialize(GameManager gameManager, BonusFruit bonusFruit, Ghost[] ghosts)
|
||||
{
|
||||
this.gameManager = gameManager;
|
||||
@@ -49,13 +51,29 @@ namespace Marro.PacManUdon
|
||||
|
||||
powerPellets = GetComponentsInChildren<Animator>(true);
|
||||
powerPelletBlinkToggleInterval = PacManConstants.GetPowerPelletBlinkToggleInterval();
|
||||
SetPowerPelletsBlink(false);
|
||||
|
||||
collisionMap = PacManConstants.GetMazeCollisionInfo();
|
||||
|
||||
RestoreAllPellets();
|
||||
|
||||
SubscribeToEvent(NetworkEventType.SyncPellets);
|
||||
|
||||
Reset();
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
SetPowerPelletsBlink(false);
|
||||
|
||||
RestoreAllPellets();
|
||||
}
|
||||
|
||||
internal void SetFrozen(bool frozen)
|
||||
{
|
||||
this.frozen = frozen;
|
||||
|
||||
if (!frozen)
|
||||
{
|
||||
SetPowerPelletsBlink(true);
|
||||
}
|
||||
}
|
||||
|
||||
#region Collision
|
||||
@@ -74,9 +92,9 @@ namespace Marro.PacManUdon
|
||||
|
||||
ghostPositions[ghostIndex] = tile;
|
||||
|
||||
if (tile == pacManPosition)
|
||||
if (!frozen && tile == pacManPosition)
|
||||
{
|
||||
Debug.Log("Ghost hit PacMan!");
|
||||
//Debug.Log("Ghost hit PacMan!");
|
||||
ghosts[ghostIndex].HitPacMan();
|
||||
}
|
||||
|
||||
@@ -90,20 +108,28 @@ namespace Marro.PacManUdon
|
||||
|
||||
pacManPosition = tilemapIndex;
|
||||
|
||||
TryEatGhost(tilemapIndex);
|
||||
if (!frozen)
|
||||
{
|
||||
PacManTryEatGhost();
|
||||
}
|
||||
|
||||
TryCollectFruit(tile, position);
|
||||
return TryCollectPellet(tile, tilemapIndex);
|
||||
}
|
||||
|
||||
private void TryEatGhost(int tilemapIndex)
|
||||
internal void PacManTryEatGhost()
|
||||
{
|
||||
for (int i = 0; i < ghosts.Length; i++)
|
||||
{
|
||||
if (ghostPositions[i] == tilemapIndex)
|
||||
if (ghostPositions[i] != pacManPosition)
|
||||
{
|
||||
Debug.Log("PacMan hit ghost!");
|
||||
ghosts[i].HitPacMan();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ghosts[i].HitPacMan()) // Only one collision may happen at a time
|
||||
{
|
||||
//Debug.Log("PacMan hit ghost!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -248,6 +274,8 @@ namespace Marro.PacManUdon
|
||||
|
||||
data.Append((byte)PelletCollectedCount, ref index);
|
||||
data.Append(syncedPelletsCollected, ref index);
|
||||
|
||||
data.Append(frozen, ref index);
|
||||
}
|
||||
|
||||
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
@@ -261,6 +289,8 @@ namespace Marro.PacManUdon
|
||||
Array.Copy(data, index, syncedPelletsCollected, 0, syncedPelletsCollected.Length);
|
||||
index += syncedPelletsCollected.Length;
|
||||
SetPelletsCollectedFromSync();
|
||||
|
||||
frozen = data.ReadBool(ref index);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,8 +136,6 @@ namespace Marro.PacManUdon
|
||||
{
|
||||
//Debug.Log($"{gameObject} New level started!");
|
||||
|
||||
collisionManager.RestoreAllPellets();
|
||||
|
||||
ghostManager.NewLevel();
|
||||
|
||||
mazeSpriteAnimator.SetBool("Blinking", false);
|
||||
@@ -153,7 +151,7 @@ namespace Marro.PacManUdon
|
||||
pacMan.Reset();
|
||||
bonusFruit.Despawn();
|
||||
soundManager.Reset();
|
||||
collisionManager.SetPowerPelletsBlink(false);
|
||||
collisionManager.Reset();
|
||||
}
|
||||
|
||||
private void PrepareForCutscene()
|
||||
@@ -391,11 +389,7 @@ namespace Marro.PacManUdon
|
||||
pacMan.SetFrozen(frozen);
|
||||
bonusFruit.SetFrozen(frozen);
|
||||
ghostManager.SetFrozen(frozen, ignoreIfCaught: ghostIgnoreIfCaught);
|
||||
|
||||
if (!frozen)
|
||||
{
|
||||
collisionManager.SetPowerPelletsBlink(true);
|
||||
}
|
||||
collisionManager.SetFrozen(frozen);
|
||||
}
|
||||
|
||||
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
|
||||
@@ -593,18 +593,23 @@ namespace Marro.PacManUdon
|
||||
}
|
||||
}
|
||||
|
||||
internal void HitPacMan()
|
||||
internal bool HitPacMan()
|
||||
{
|
||||
if (ghostState != PacManGhostState.Normal)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isScared)
|
||||
{
|
||||
Debug.Log($"{gameObject} was cought!");
|
||||
ghostManager.GhostCaughtQueue(this);
|
||||
//Debug.Log($"{gameObject} was cought!");
|
||||
ghostManager.GhostCaught(this);
|
||||
return true;
|
||||
}
|
||||
else if (ghostState == PacManGhostState.Normal)
|
||||
{
|
||||
Debug.Log($"{gameObject} cought PacMan!");
|
||||
|
||||
//Debug.Log($"{gameObject} cought PacMan!");
|
||||
ghostManager.CapturedPacMan();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Caught(int scoreBonus)
|
||||
@@ -695,16 +700,20 @@ namespace Marro.PacManUdon
|
||||
|
||||
public void SetFrozen(bool frozen, bool ignoreIfCaught = false, bool keepAnimating = false)
|
||||
{
|
||||
animator.speed = frozen && !keepAnimating ? 0 : 1; // This would cause issues if the returning sprite was animated, luckily it isn't :)
|
||||
|
||||
if (frozen && !ignoreIfCaught)
|
||||
{
|
||||
frozenState = PacManGhostFrozenState.Frozen;
|
||||
return;
|
||||
}
|
||||
else if (frozen && ignoreIfCaught)
|
||||
|
||||
if (frozen && ignoreIfCaught)
|
||||
{
|
||||
frozenState = PacManGhostFrozenState.FrozenIfNotCaught;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var oldFrozenState = frozenState;
|
||||
frozenState = PacManGhostFrozenState.NotFrozen;
|
||||
|
||||
@@ -712,8 +721,11 @@ namespace Marro.PacManUdon
|
||||
{
|
||||
UpdateAnimator();
|
||||
}
|
||||
|
||||
if (ghostState == PacManGhostState.CaughtScore)
|
||||
{
|
||||
ReturnHome(); // Return home when unfreezing after being caught
|
||||
}
|
||||
animator.speed = frozen && !keepAnimating ? 0 : 1; // This would cause issues if the returning sprite was animated, luckily it isn't :)
|
||||
}
|
||||
|
||||
public void SetHousePelletCounterActive(bool active)
|
||||
|
||||
@@ -43,7 +43,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 33
|
||||
Data: 32
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@@ -1081,64 +1081,10 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: ghostScaredQueue
|
||||
Data: blinkingActivated
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: ghostScaredQueue
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 55|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.SDK3.Data.DataList, VRCSDK3
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 55
|
||||
- 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: 56|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: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: blinkingActivated
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: blinkingActivated
|
||||
@@ -1162,7 +1108,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1186,7 +1132,7 @@ MonoBehaviour:
|
||||
Data: blinkCountdown
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 56|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: blinkCountdown
|
||||
@@ -1210,7 +1156,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 60|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 57|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1234,7 +1180,7 @@ MonoBehaviour:
|
||||
Data: blinkCurrentlyWhite
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: blinkCurrentlyWhite
|
||||
@@ -1258,7 +1204,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 62|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1282,7 +1228,7 @@ MonoBehaviour:
|
||||
Data: scatterCounter
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 63|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 60|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: scatterCounter
|
||||
@@ -1306,7 +1252,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 64|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 61|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1330,7 +1276,7 @@ MonoBehaviour:
|
||||
Data: scatterPatternIndex
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 62|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: scatterPatternIndex
|
||||
@@ -1354,7 +1300,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 66|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 63|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1378,7 +1324,7 @@ MonoBehaviour:
|
||||
Data: elroyLevel
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 64|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: elroyLevel
|
||||
@@ -1402,7 +1348,7 @@ MonoBehaviour:
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 68|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 65|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1426,7 +1372,7 @@ MonoBehaviour:
|
||||
Data: sharedPelletCounterActive
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 69|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 66|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: sharedPelletCounterActive
|
||||
@@ -1450,7 +1396,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 70|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 67|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1474,7 +1420,7 @@ MonoBehaviour:
|
||||
Data: sharedPelletCounter
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 71|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: sharedPelletCounter
|
||||
@@ -1496,6 +1442,60 @@ MonoBehaviour:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 69|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: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: sharedPelletCounterReleaseValues
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: sharedPelletCounterReleaseValues
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 71|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Int32[], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 71
|
||||
- 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: 72|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
@@ -1519,64 +1519,10 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: sharedPelletCounterReleaseValues
|
||||
Data: pelletTimeout
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: sharedPelletCounterReleaseValues
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 74|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Int32[], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 74
|
||||
- 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: 75|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: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: pelletTimeout
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: pelletTimeout
|
||||
@@ -1600,7 +1546,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 77|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 74|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1624,7 +1570,7 @@ MonoBehaviour:
|
||||
Data: frozen
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 78|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 75|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: frozen
|
||||
@@ -1648,7 +1594,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 79|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 76|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1672,7 +1618,7 @@ MonoBehaviour:
|
||||
Data: kinematic
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 80|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 77|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: kinematic
|
||||
@@ -1696,7 +1642,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 81|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 78|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
|
||||
@@ -33,8 +33,6 @@ namespace Marro.PacManUdon
|
||||
private float powerPelletCountdown;
|
||||
private int powerPelletMultiplier;
|
||||
|
||||
private DataList ghostScaredQueue;
|
||||
|
||||
// Blink logic
|
||||
private const float blinkCycleRate = 0.233333333f;
|
||||
private bool blinkingActivated;
|
||||
@@ -80,7 +78,6 @@ namespace Marro.PacManUdon
|
||||
|
||||
public void RestartLevel(bool afterLifeLost = false)
|
||||
{
|
||||
ghostScaredQueue = new DataList();
|
||||
powerPelletActive = false;
|
||||
scatterCounter = 0;
|
||||
scatterPatternIndex = 0;
|
||||
@@ -186,7 +183,7 @@ namespace Marro.PacManUdon
|
||||
}
|
||||
}
|
||||
|
||||
public void GhostCaughtQueue(Ghost ghost)
|
||||
public void GhostCaught(Ghost ghost)
|
||||
{
|
||||
if (gameController.GameState == PacManGameState.AttractMode)
|
||||
{
|
||||
@@ -194,34 +191,6 @@ namespace Marro.PacManUdon
|
||||
return;
|
||||
}
|
||||
|
||||
// Debug.Log($"{gameObject} GhostCaughtQueue with ghost {ghost}");
|
||||
//networkManager.SendEventSoon(NetworkEventType.TimeSequenceSync);
|
||||
//networkManager.SendEventSoon(NetworkEventType.GhostUpdate);
|
||||
|
||||
ghostScaredQueue.Add(ghost);
|
||||
GhostCaughtExecute(ghost);
|
||||
}
|
||||
|
||||
public void GhostCaughtContinue()
|
||||
{
|
||||
// Debug.Log($"{gameObject} GhostCaughtContinue with ghost queue length {ghostScaredQueue.Count}");
|
||||
if (!ghostScaredQueue.TryGetValue(0, out DataToken currentGhost))
|
||||
{
|
||||
Debug.LogError("Called GhostCaughtContinue without a ghost in the queue!");
|
||||
return;
|
||||
}
|
||||
|
||||
((Ghost)currentGhost.Reference).ReturnHome();
|
||||
ghostScaredQueue.RemoveAt(0);
|
||||
|
||||
if (ghostScaredQueue.TryGetValue(0, out DataToken nextGhost))
|
||||
{
|
||||
GhostCaughtExecute((Ghost)nextGhost.Reference);
|
||||
}
|
||||
}
|
||||
|
||||
void GhostCaughtExecute(Ghost ghost)
|
||||
{
|
||||
int scoreBonus = 200 * (int)Math.Pow(2, powerPelletMultiplier);
|
||||
powerPelletMultiplier += 1;
|
||||
ghost.Caught(scoreBonus);
|
||||
@@ -518,20 +487,6 @@ namespace Marro.PacManUdon
|
||||
data.Append(kinematic, ref index);
|
||||
|
||||
data.AppendAsByte(gameController.Level, ref index);
|
||||
|
||||
var ghostScaredQueueArray = new byte[ghosts.Length];
|
||||
for (int i = 0; i < ghostScaredQueueArray.Length; i++)
|
||||
{
|
||||
var add = ghostScaredQueue.TryGetValue(i, out var ghost);
|
||||
if (!add)
|
||||
{
|
||||
ghostScaredQueueArray[i] = byte.MaxValue; // Add a terminator
|
||||
break;
|
||||
}
|
||||
ghostScaredQueueArray[i] = (byte)((Ghost)ghost.Reference).Index;
|
||||
}
|
||||
//Debug.Log($"{gameObject} Sent a ghostScareQueue of length {ghostScaredQueue.Count}");
|
||||
data.Append(ghostScaredQueueArray, ref index);
|
||||
}
|
||||
|
||||
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
@@ -569,19 +524,6 @@ namespace Marro.PacManUdon
|
||||
var level = data.ReadByte(ref index);
|
||||
SetLevelConstants(level);
|
||||
|
||||
ghostScaredQueue.Clear();
|
||||
for (int i = 0; i < ghosts.Length; i++)
|
||||
{
|
||||
var ghostIndex = data[index + i];
|
||||
if (ghostIndex > ghosts.Length) // Reached terminator
|
||||
{
|
||||
break;
|
||||
}
|
||||
ghostScaredQueue.Add(ghosts[ghostIndex]);
|
||||
}
|
||||
index += ghosts.Length;
|
||||
//Debug.Log($"{gameObject} Read back a ghostScareQueue of length {ghostScaredQueue.Count}");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -327,7 +327,7 @@ namespace Marro.PacManUdon
|
||||
obj.networkManager = this;
|
||||
}
|
||||
|
||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Found {syncedUpdateSubscribers.Length} {nameof(SyncedObject)} in children of {root.name}.");
|
||||
//Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Found {syncedUpdateSubscribers.Length} {nameof(SyncedObject)} in children of {root.name}.");
|
||||
|
||||
const int eventTypeCount = byte.MaxValue + 1;
|
||||
|
||||
@@ -375,7 +375,7 @@ namespace Marro.PacManUdon
|
||||
RequestEvent(NetworkEventType.FullSync);
|
||||
}
|
||||
|
||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Initialized");
|
||||
//Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Initialized");
|
||||
}
|
||||
|
||||
public void Update()
|
||||
@@ -501,7 +501,7 @@ namespace Marro.PacManUdon
|
||||
|
||||
if (!IsOwner)
|
||||
{
|
||||
Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Attempted {nameof(SendEventSoon)} while not the owner!");
|
||||
//Debug.LogWarning($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Attempted {nameof(SendEventSoon)} while not the owner!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -567,7 +567,7 @@ namespace Marro.PacManUdon
|
||||
|
||||
QueueEventInBuffer(data);
|
||||
|
||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Prepared event of type {eventType} with {data.Length} bytes, timestamp {timestamp} and id {eventId} for serialization.");
|
||||
//Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Prepared event of type {eventType} with {data.Length} bytes, timestamp {timestamp} and id {eventId} for serialization.");
|
||||
|
||||
RequestSerializationForEvents();
|
||||
|
||||
@@ -647,7 +647,7 @@ namespace Marro.PacManUdon
|
||||
|
||||
serializationRequested = false;
|
||||
|
||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Serializing {eventsQueueIndex} event(s), eventTransmissionHistory is now {ArrayToString(eventTransmissionHistory)} with index {eventTransmissionHistoryIndex}");
|
||||
//Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Serializing {eventsQueueIndex} event(s), eventTransmissionHistory is now {ArrayToString(eventTransmissionHistory)} with index {eventTransmissionHistoryIndex}");
|
||||
}
|
||||
|
||||
public override void OnPostSerialization(SerializationResult result) => OnPostSerializationInternal(result.success, result.byteCount);
|
||||
@@ -666,7 +666,7 @@ namespace Marro.PacManUdon
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Serialized with {networkedData.Length} bytes.\nBytes sent:\n{ArrayToString(networkedData)}");
|
||||
//Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Serialized with {networkedData.Length} bytes.\nBytes sent:\n{ArrayToString(networkedData)}");
|
||||
|
||||
// Remove data from the buffer that no longer needs to be (re)transmitted
|
||||
DequeueEventsFromBuffer(eventTransmissionHistory[eventTransmissionHistoryIndex]);
|
||||
@@ -711,7 +711,7 @@ namespace Marro.PacManUdon
|
||||
return; // Nothing to store
|
||||
}
|
||||
|
||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Received {networkedData.Length} bytes!\nBytes received:\n{ArrayToString(networkedData)}");
|
||||
//Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Received {networkedData.Length} bytes!\nBytes received:\n{ArrayToString(networkedData)}");
|
||||
|
||||
var length = networkedData.Length;
|
||||
int index = 0;
|
||||
@@ -798,7 +798,7 @@ namespace Marro.PacManUdon
|
||||
|
||||
hasFullSyncReady = true;
|
||||
|
||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Queued full sync in buffer, should execute at {nextEventTime}.");
|
||||
//Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Queued full sync in buffer, should execute at {nextEventTime}.");
|
||||
}
|
||||
|
||||
private void ApplyReceivedEvents()
|
||||
@@ -842,7 +842,7 @@ namespace Marro.PacManUdon
|
||||
|
||||
var subscribers = GetEventSubscribers(eventType);
|
||||
|
||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) ApplyEvent with dt {SyncedDeltaTime}");
|
||||
//Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) ApplyEvent with dt {SyncedDeltaTime}");
|
||||
|
||||
if (subscribers != null)
|
||||
{
|
||||
@@ -878,7 +878,7 @@ namespace Marro.PacManUdon
|
||||
Synced = true;
|
||||
}
|
||||
|
||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Performed incoming event of type {eventType}! Total {index} bytes.");
|
||||
//Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Performed incoming event of type {eventType}! Total {index} bytes.");
|
||||
|
||||
retriesWithoutSuccess = 0; // We had success!
|
||||
|
||||
@@ -970,7 +970,7 @@ namespace Marro.PacManUdon
|
||||
SyncedTime = SyncedTimeTicks * tickDelta;
|
||||
nextEventTime = timestamp;
|
||||
|
||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Synced to timestamp {timestamp}, internalTime is now {targetTicks}, SyncedTime is now {SyncedTime}, nextEventTime is now {nextEventTime}");
|
||||
//Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Synced to timestamp {timestamp}, internalTime is now {targetTicks}, SyncedTime is now {SyncedTime}, nextEventTime is now {nextEventTime}");
|
||||
}
|
||||
|
||||
private void UpdateNextEventTime()
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace Marro.PacManUdon
|
||||
|
||||
protected override void UpdateAnimator()
|
||||
{
|
||||
Debug.Log($"{gameObject} UpdateAnimator with direction {direction}, dead {dead}, frozen {frozen}");
|
||||
//Debug.Log($"{gameObject} UpdateAnimator with direction {direction}, dead {dead}, frozen {frozen}");
|
||||
if (!gameObject.activeInHierarchy)
|
||||
return;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 10
|
||||
Data: 11
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@@ -217,31 +217,25 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: resultInput
|
||||
Data: player
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: resultInput
|
||||
Data: player
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 13|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.Direction, Assembly-CSharp
|
||||
Data: VRC.SDKBase.VRCPlayerApi, VRCSDKBase
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 14|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Int32, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
Entry: 9
|
||||
Data: 13
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -256,7 +250,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -277,19 +271,25 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: inputHorizontal
|
||||
Data: inputMethod
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: inputHorizontal
|
||||
Data: inputMethod
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 13
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 14
|
||||
Entry: 7
|
||||
Data: 16|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
|
||||
@@ -325,19 +325,25 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: inputVertical
|
||||
Data: resultInput
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: inputVertical
|
||||
Data: resultInput
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 13
|
||||
Entry: 7
|
||||
Data: 19|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.Direction, Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 14
|
||||
Data: 16
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -352,7 +358,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -373,25 +379,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: horizontalValue
|
||||
Data: inputHorizontal
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: horizontalValue
|
||||
Data: inputHorizontal
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 21|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Single, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
Entry: 9
|
||||
Data: 19
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 21
|
||||
Data: 16
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -427,19 +427,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: verticalValue
|
||||
Data: inputVertical
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: verticalValue
|
||||
Data: inputVertical
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 21
|
||||
Data: 19
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 21
|
||||
Data: 16
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -475,19 +475,25 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: horizontalPriority
|
||||
Data: horizontalValue
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: horizontalPriority
|
||||
Data: horizontalValue
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 7
|
||||
Entry: 7
|
||||
Data: 26|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Single, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 7
|
||||
Data: 26
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -502,7 +508,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -523,25 +529,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: player
|
||||
Data: verticalValue
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: player
|
||||
Data: verticalValue
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 28|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.SDKBase.VRCPlayerApi, VRCSDKBase
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
Entry: 9
|
||||
Data: 26
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 28
|
||||
Data: 26
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -572,6 +572,54 @@ MonoBehaviour:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: horizontalPriority
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: horizontalPriority
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 7
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 7
|
||||
- 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: 31|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:
|
||||
|
||||
@@ -5,17 +5,27 @@
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon.Common;
|
||||
|
||||
enum InputMethod
|
||||
{
|
||||
KeyboardMouse,
|
||||
Other,
|
||||
}
|
||||
|
||||
public class PlayerInput : SyncedObject
|
||||
{
|
||||
public bool active;
|
||||
|
||||
private GameManager gameManager;
|
||||
Direction resultInput;
|
||||
Direction inputHorizontal;
|
||||
Direction inputVertical;
|
||||
float horizontalValue;
|
||||
float verticalValue;
|
||||
bool horizontalPriority;
|
||||
VRCPlayerApi player;
|
||||
|
||||
private VRCPlayerApi player;
|
||||
private InputMethod inputMethod;
|
||||
|
||||
private Direction resultInput;
|
||||
private Direction inputHorizontal;
|
||||
private Direction inputVertical;
|
||||
private float horizontalValue;
|
||||
private float verticalValue;
|
||||
private bool horizontalPriority;
|
||||
|
||||
public void Initialize(GameManager gameManager)
|
||||
{
|
||||
@@ -143,11 +153,29 @@
|
||||
// Debug.Log("Vertical Input Event: " + value + " | Direction: " + direction + " | lastDirection : " + lastDirection);
|
||||
}
|
||||
|
||||
public override void OnInputMethodChanged(VRCInputMethod inputMethod)
|
||||
{
|
||||
switch (inputMethod)
|
||||
{
|
||||
case VRCInputMethod.Keyboard:
|
||||
case VRCInputMethod.Mouse:
|
||||
this.inputMethod = InputMethod.KeyboardMouse;
|
||||
return;
|
||||
default:
|
||||
this.inputMethod = InputMethod.Other;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void SetPriority(bool horizontalPriority)
|
||||
{
|
||||
if (this.horizontalPriority != horizontalPriority)
|
||||
{
|
||||
if (inputMethod != InputMethod.KeyboardMouse)
|
||||
{
|
||||
player.PlayHapticEventInHand(VRC_Pickup.PickupHand.Left, 0.1f, 0.15f, 75);
|
||||
}
|
||||
|
||||
this.horizontalPriority = horizontalPriority;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,7 +323,6 @@ namespace Marro.PacManUdon
|
||||
break;
|
||||
case 3:
|
||||
SetPelletsActive(true);
|
||||
collisionManager.RestoreAllPellets();
|
||||
statusDisplay.SetGameOverTextVisible(true);
|
||||
break;
|
||||
case 4:
|
||||
|
||||
@@ -21,8 +21,7 @@ namespace Marro.PacManUdon
|
||||
{
|
||||
// Unfreeze and reveal pacman
|
||||
SetPacManActive(true);
|
||||
SetFrozen(false);
|
||||
ghostManager.GhostCaughtContinue();
|
||||
SetFrozen(false); // This also makes the caught ghost return home
|
||||
soundManager.SetGhostRetreat(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class NetworkManagerTester : UdonSharpBehaviour
|
||||
|
||||
var data = PerformSerialization(source);
|
||||
|
||||
Debug.Log($"{nameof(NetworkManagerTester)} Transferring {data.Length} bytes.");
|
||||
//Debug.Log($"{nameof(NetworkManagerTester)} Transferring {data.Length} bytes.");
|
||||
|
||||
foreach (var target in networkManagers)
|
||||
{
|
||||
@@ -91,7 +91,7 @@ public class NetworkManagerTester : UdonSharpBehaviour
|
||||
continue;
|
||||
}
|
||||
|
||||
Debug.Log($"{nameof(NetworkManagerTester)} Requested event with type {eventType}.");
|
||||
//Debug.Log($"{nameof(NetworkManagerTester)} Requested event with type {eventType}.");
|
||||
|
||||
target.RequestEventReceived(eventType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user