Compare commits
12 Commits
cb975c24b2
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| b688b4739b | |||
| 1252933ca4 | |||
| d6b870de79 | |||
| 8a6f1b482b | |||
| 18499ab576 | |||
| a32df1bd09 | |||
| d739c9d7b5 | |||
| 4ba203b1de | |||
| 7f87a9779b | |||
| 99556b81b1 | |||
| ca116ac77f | |||
| e431dab042 |
@@ -458,7 +458,8 @@ Transform:
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Children:
|
||||
- {fileID: 1470248941}
|
||||
m_Father: {fileID: 1886023632}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &107806787
|
||||
@@ -4137,7 +4138,7 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 805005470}
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 45115577ef41a5b4ca741ed302693907, type: 3}
|
||||
m_Name:
|
||||
@@ -4162,7 +4163,7 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 805005470}
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: cbbf384cde136444d9f640ff9f3445cf, type: 3}
|
||||
m_Name:
|
||||
@@ -8438,6 +8439,37 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1465823362}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1470248940
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1470248941}
|
||||
m_Layer: 0
|
||||
m_Name: Check if ghost behaviour per level is correct
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1470248941
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1470248940}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 106401850}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1472000832 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 6334235783093999612, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
@@ -14567,6 +14599,54 @@ PrefabInstance:
|
||||
propertyPath: serializationData.Prefab
|
||||
value:
|
||||
objectReference: {fileID: 4698741626709871998, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 0.21968801
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 0.21968801
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 0.21968801
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -0.23
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 7.61
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -20.12
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 0.6825807
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0.6825807
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0.18461756
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0.18461756
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: -90
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4729227370507332304, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 30.269
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4751825057426557829, guid: 15ac0ed4c56c7784ea3ae9000fc2af1f, type: 3}
|
||||
propertyPath: serializationData.Prefab
|
||||
value:
|
||||
|
||||
@@ -8,15 +8,16 @@ namespace Marro.PacManUdon
|
||||
[RequireComponent(typeof(Renderer))]
|
||||
public class BonusFruit : SyncedObject
|
||||
{
|
||||
PacManFruitType fruitType;
|
||||
private PacManFruitType fruitType;
|
||||
|
||||
Animator animator;
|
||||
new Renderer renderer;
|
||||
ScoreBonusDisplay scoreBonusDisplay;
|
||||
private Animator animator;
|
||||
private new Renderer renderer;
|
||||
private ScoreBonusDisplay scoreBonusDisplay;
|
||||
|
||||
[UdonSynced] bool active;
|
||||
private int value;
|
||||
private bool active;
|
||||
private float activeCountdown;
|
||||
|
||||
private int value;
|
||||
private bool frozen;
|
||||
|
||||
public void Initialize()
|
||||
@@ -30,13 +31,15 @@ namespace Marro.PacManUdon
|
||||
|
||||
public override void SyncedUpdate()
|
||||
{
|
||||
if (active && !frozen)
|
||||
if (!active || frozen)
|
||||
{
|
||||
activeCountdown -= networkManager.SyncedDeltaTime;
|
||||
if (activeCountdown <= 0)
|
||||
{
|
||||
SetActive(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
activeCountdown -= networkManager.SyncedDeltaTime;
|
||||
if (activeCountdown <= 0)
|
||||
{
|
||||
SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +65,6 @@ namespace Marro.PacManUdon
|
||||
|
||||
public void SetFruitType(PacManFruitType fruitType)
|
||||
{
|
||||
this.fruitType = fruitType;
|
||||
value = (int)fruitScoreValue[PacManConstants.FruitTypeToValue(fruitType)];
|
||||
animator.SetFloat("FruitType", PacManConstants.FruitTypeToValue(fruitType));
|
||||
}
|
||||
@@ -80,31 +82,33 @@ namespace Marro.PacManUdon
|
||||
|
||||
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
data.Append(active, ref index);
|
||||
|
||||
if (!active)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
data.Append(activeCountdown, ref index);
|
||||
data.Append(frozen, ref index);
|
||||
}
|
||||
|
||||
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
SetActive(data.ReadBool(ref index));
|
||||
|
||||
if (!active)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
activeCountdown = data.ReadFloat(ref index);
|
||||
frozen = data.ReadBool(ref index);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public PacManFruitType FruitType
|
||||
{
|
||||
set
|
||||
{
|
||||
SetFruitType(value);
|
||||
}
|
||||
get => fruitType;
|
||||
}
|
||||
|
||||
public bool Active
|
||||
{
|
||||
set
|
||||
{
|
||||
SetActive(value);
|
||||
}
|
||||
get => active;
|
||||
}
|
||||
public bool Active => active;
|
||||
|
||||
private readonly DataDictionary fruitScoreValue = new DataDictionary()
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 16
|
||||
Data: 18
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@@ -109,25 +109,25 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: <PelletCollectedCount>k__BackingField
|
||||
Data: gameManager
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: <PelletCollectedCount>k__BackingField
|
||||
Data: gameManager
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 7|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Int32, mscorlib
|
||||
Data: Marro.PacManUdon.GameManager, Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 7
|
||||
Data: 4
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -163,19 +163,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: gameManager
|
||||
Data: bonusFruit
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: gameManager
|
||||
Data: bonusFruit
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 10|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.GameManager, Assembly-CSharp
|
||||
Data: Marro.PacManUdon.BonusFruit, Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -217,25 +217,31 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: bonusFruit
|
||||
Data: pellets
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 12|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: bonusFruit
|
||||
Data: pellets
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 13|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.BonusFruit, Assembly-CSharp
|
||||
Data: Marro.PacManUdon.Pellet[], Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 4
|
||||
Entry: 7
|
||||
Data: 14|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.Component[], UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -250,7 +256,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 14|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -271,31 +277,25 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: pellets
|
||||
Data: powerPellets
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: pellets
|
||||
Data: powerPellets
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 16|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.Pellet[], Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 17|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.Component[], UnityEngine.CoreModule
|
||||
Data: UnityEngine.Animator[], UnityEngine.AnimationModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 17
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -331,25 +331,25 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: powerPellets
|
||||
Data: ghosts
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: powerPellets
|
||||
Data: ghosts
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 20|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.Animator[], UnityEngine.AnimationModule
|
||||
Data: Marro.PacManUdon.Ghost[], Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 20
|
||||
Data: 14
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -385,25 +385,25 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: ghosts
|
||||
Data: collisionMap
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: ghosts
|
||||
Data: collisionMap
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 23|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.Ghost[], Assembly-CSharp
|
||||
Data: System.Byte[], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 17
|
||||
Data: 23
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -439,19 +439,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: powerPelletBlinkEnabled
|
||||
Data: pelletIndices
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: powerPelletBlinkEnabled
|
||||
Data: pelletIndices
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 26|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Boolean, mscorlib
|
||||
Data: System.Int32[], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -493,19 +493,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: powerPelletBlinkToggleInterval
|
||||
Data: powerPelletBlinkEnabled
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: powerPelletBlinkToggleInterval
|
||||
Data: powerPelletBlinkEnabled
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 29|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Single, mscorlib
|
||||
Data: System.Boolean, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -547,19 +547,73 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: powerPelletBlinkProgress
|
||||
Data: powerPelletBlinkToggleInterval
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: powerPelletBlinkToggleInterval
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 32|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Single, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 32
|
||||
- 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: 33|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: powerPelletBlinkProgress
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: powerPelletBlinkProgress
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 29
|
||||
Data: 32
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 29
|
||||
Data: 32
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -574,7 +628,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -598,70 +652,16 @@ MonoBehaviour:
|
||||
Data: powerPelletBlinkCurrentlyVisible
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: powerPelletBlinkCurrentlyVisible
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 26
|
||||
Data: 29
|
||||
- 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: 34|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: syncedPelletsCollected
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: syncedPelletsCollected
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 36|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Byte[], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 36
|
||||
Data: 29
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -697,19 +697,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: collisionMap
|
||||
Data: pelletMap
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: collisionMap
|
||||
Data: pelletMap
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 36
|
||||
Data: 23
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 36
|
||||
Data: 23
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -745,19 +745,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: pelletMap
|
||||
Data: syncedPelletsCollected
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: pelletMap
|
||||
Data: syncedPelletsCollected
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 36
|
||||
Data: 23
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 36
|
||||
Data: 23
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -793,19 +793,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: ghostPositions
|
||||
Data: pelletCollectedCount
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: ghostPositions
|
||||
Data: pelletCollectedCount
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 43|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Int32[], mscorlib
|
||||
Data: System.Byte, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -847,19 +847,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: pacManPosition
|
||||
Data: ghostPositions
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: pacManPosition
|
||||
Data: ghostPositions
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 7
|
||||
Data: 26
|
||||
- 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
|
||||
@@ -890,6 +890,108 @@ MonoBehaviour:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: pacManPosition
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: pacManPosition
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 48|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Int32, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 48
|
||||
- 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: 49|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: frozen
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: frozen
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 29
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 29
|
||||
- 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: 51|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:
|
||||
|
||||
@@ -13,31 +13,33 @@ namespace Marro.PacManUdon
|
||||
public class CollisionManager : SyncedObject
|
||||
{
|
||||
public int PelletCount => pellets.Length;
|
||||
public int PelletCollectedCount { get; private set; }
|
||||
|
||||
private GameManager gameManager;
|
||||
private BonusFruit bonusFruit;
|
||||
private Pellet[] pellets;
|
||||
private Animator[] powerPellets;
|
||||
private Ghost[] ghosts;
|
||||
|
||||
Pellet[] pellets;
|
||||
Animator[] powerPellets;
|
||||
Ghost[] ghosts;
|
||||
private byte[] collisionMap;
|
||||
private int[] pelletIndices;
|
||||
|
||||
bool powerPelletBlinkEnabled;
|
||||
float powerPelletBlinkToggleInterval;
|
||||
float powerPelletBlinkProgress;
|
||||
bool powerPelletBlinkCurrentlyVisible;
|
||||
private const int mazeWidth = 32;
|
||||
private const int mazeHeight = 32;
|
||||
|
||||
byte[] syncedPelletsCollected;
|
||||
private bool powerPelletBlinkEnabled;
|
||||
private float powerPelletBlinkToggleInterval;
|
||||
private float powerPelletBlinkProgress;
|
||||
private bool powerPelletBlinkCurrentlyVisible;
|
||||
|
||||
byte[] collisionMap;
|
||||
byte[] pelletMap;
|
||||
|
||||
const int mazeWidth = 32;
|
||||
const int mazeHeight = 32;
|
||||
private byte[] pelletMap;
|
||||
private byte[] syncedPelletsCollected;
|
||||
private byte pelletCollectedCount;
|
||||
|
||||
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,28 @@ namespace Marro.PacManUdon
|
||||
|
||||
powerPellets = GetComponentsInChildren<Animator>(true);
|
||||
powerPelletBlinkToggleInterval = PacManConstants.GetPowerPelletBlinkToggleInterval();
|
||||
SetPowerPelletsBlink(false);
|
||||
|
||||
collisionMap = PacManConstants.GetMazeCollisionInfo();
|
||||
pelletIndices = PacManConstants.GetMazePelletIndices();
|
||||
|
||||
Reset();
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
SetPowerPelletsBlink(false);
|
||||
|
||||
RestoreAllPellets();
|
||||
}
|
||||
|
||||
SubscribeToEvent(NetworkEventType.SyncPellets);
|
||||
internal void SetFrozen(bool frozen)
|
||||
{
|
||||
this.frozen = frozen;
|
||||
|
||||
if (!frozen)
|
||||
{
|
||||
SetPowerPelletsBlink(true);
|
||||
}
|
||||
}
|
||||
|
||||
#region Collision
|
||||
@@ -74,9 +91,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 +107,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -162,11 +187,11 @@ namespace Marro.PacManUdon
|
||||
var index = pellet.transform.GetSiblingIndex();
|
||||
syncedPelletsCollected[index / 8] |= (byte)(1 << index % 8);
|
||||
|
||||
PelletCollectedCount++;
|
||||
pelletCollectedCount++;
|
||||
|
||||
var pelletType = pellet.isPowerPellet ? EatResult.PowerPellet : EatResult.Pellet;
|
||||
|
||||
gameManager.GotPellet(pellet, pellet.isPowerPellet, PelletCollectedCount, PelletCount - PelletCollectedCount);
|
||||
gameManager.GotPellet(pellet, pellet.isPowerPellet, pelletCollectedCount, PelletCount - pelletCollectedCount);
|
||||
|
||||
return pelletType;
|
||||
}
|
||||
@@ -179,7 +204,7 @@ namespace Marro.PacManUdon
|
||||
}
|
||||
|
||||
syncedPelletsCollected = new byte[pellets.Length/8 + 1];
|
||||
PelletCollectedCount = 0;
|
||||
pelletCollectedCount = 0;
|
||||
|
||||
pelletMap = PacManConstants.GetMazePelletMap();
|
||||
|
||||
@@ -188,10 +213,11 @@ namespace Marro.PacManUdon
|
||||
|
||||
private void SetPelletsCollectedFromSync()
|
||||
{
|
||||
for (int i = 0; i < pellets.Length; i++)
|
||||
for (byte i = 0; i < pellets.Length; i++)
|
||||
{
|
||||
var active = (syncedPelletsCollected[i/8] & (byte)(1 << i%8)) == 0;
|
||||
pellets[i].gameObject.SetActive(active);
|
||||
pelletMap[pelletIndices[i]] = i;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -241,26 +267,20 @@ namespace Marro.PacManUdon
|
||||
|
||||
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
if (eventType != NetworkEventType.SyncPellets)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
data.Append((byte)PelletCollectedCount, ref index);
|
||||
data.Append(pelletCollectedCount, ref index);
|
||||
data.Append(syncedPelletsCollected, ref index);
|
||||
|
||||
data.Append(frozen, ref index);
|
||||
}
|
||||
|
||||
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
if (eventType != NetworkEventType.SyncPellets)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
PelletCollectedCount = data.ReadByte(ref index);
|
||||
pelletCollectedCount = data.ReadByte(ref index);
|
||||
Array.Copy(data, index, syncedPelletsCollected, 0, syncedPelletsCollected.Length);
|
||||
index += syncedPelletsCollected.Length;
|
||||
SetPelletsCollectedFromSync();
|
||||
|
||||
frozen = data.ReadBool(ref index);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,8 +354,8 @@ MonoBehaviour:
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 3
|
||||
Data: 1
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -367,13 +367,7 @@ MonoBehaviour:
|
||||
Data: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 22|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
@@ -391,19 +385,25 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: value
|
||||
Data: activeCountdown
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: value
|
||||
Data: activeCountdown
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
Entry: 7
|
||||
Data: 23|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Single, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
Data: 23
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -439,25 +439,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: activeCountdown
|
||||
Data: value
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: activeCountdown
|
||||
Data: value
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 26|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Single, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 26
|
||||
Data: 8
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -472,7 +466,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -496,7 +490,7 @@ MonoBehaviour:
|
||||
Data: frozen
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: frozen
|
||||
@@ -520,7 +514,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 28|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -544,13 +538,13 @@ MonoBehaviour:
|
||||
Data: fruitScoreValue
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: fruitScoreValue
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 31|System.RuntimeType, mscorlib
|
||||
Data: 30|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.SDK3.Data.DataDictionary, VRCSDK3
|
||||
@@ -559,7 +553,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 31
|
||||
Data: 30
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -574,7 +568,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
|
||||
@@ -16,7 +16,6 @@ namespace Marro.PacManUdon
|
||||
[SerializeField] private GameObject intermissionScreen;
|
||||
[SerializeField] private GameObject pressStartButtonScreen;
|
||||
[SerializeField] private PlayerInput playerInput;
|
||||
[SerializeField] private Animator demo;
|
||||
[SerializeField] private SoundManager soundManager;
|
||||
[SerializeField] private NetworkManager networkManagerSetup;
|
||||
|
||||
@@ -68,7 +67,7 @@ namespace Marro.PacManUdon
|
||||
intermission2Pole.Initialize(this, ghostManager.Ghosts[0]);
|
||||
|
||||
SubscribeToEvent(NetworkEventType.StartGameButtonPressed);
|
||||
SubscribeToEvent(NetworkEventType.TimeSequenceSync);
|
||||
SubscribeToEvent(NetworkEventType.FullSync);
|
||||
|
||||
HideEverything();
|
||||
|
||||
@@ -132,28 +131,18 @@ namespace Marro.PacManUdon
|
||||
SetLevel(1);
|
||||
}
|
||||
|
||||
private void InitializeLevel()
|
||||
{
|
||||
//Debug.Log($"{gameObject} New level started!");
|
||||
|
||||
collisionManager.RestoreAllPellets();
|
||||
|
||||
ghostManager.NewLevel();
|
||||
|
||||
mazeSpriteAnimator.SetBool("Blinking", false);
|
||||
}
|
||||
|
||||
private void RestartLevel(bool afterLifeLost = false)
|
||||
{
|
||||
//Debug.Log($"{gameObject} (Re)started level!");
|
||||
|
||||
// SetInGameComponentVisibility(true);
|
||||
mazeSpriteAnimator.SetBool("Blinking", false);
|
||||
|
||||
ghostManager.RestartLevel(afterLifeLost);
|
||||
pacMan.Reset();
|
||||
bonusFruit.Despawn();
|
||||
soundManager.Reset();
|
||||
collisionManager.SetPowerPelletsBlink(false);
|
||||
collisionManager.Reset();
|
||||
statusDisplay.Reset();
|
||||
}
|
||||
|
||||
private void PrepareForCutscene()
|
||||
@@ -229,7 +218,6 @@ namespace Marro.PacManUdon
|
||||
|
||||
AddScore(scoreBonus);
|
||||
StartTimeSequence(PacManTimeSequence.GhostCaught);
|
||||
pacMan.HideUntilUnfrozen();
|
||||
}
|
||||
|
||||
public void PacManCaught()
|
||||
@@ -275,7 +263,6 @@ namespace Marro.PacManUdon
|
||||
statusDisplay.SetLevelDisplayVisible(false);
|
||||
statusDisplay.SetPlayer1TextVisible(false);
|
||||
statusDisplay.SetReadyTextVisible(false);
|
||||
demo.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
void SetPelletsActive(bool active)
|
||||
@@ -385,36 +372,66 @@ namespace Marro.PacManUdon
|
||||
soundManager.PlayExtraLifeSound();
|
||||
}
|
||||
|
||||
private void SetupInGameState()
|
||||
{
|
||||
gameState = PacManGameState.InGame;
|
||||
|
||||
attractScreen.gameObject.SetActive(false);
|
||||
|
||||
SetPelletsActive(true);
|
||||
SetMazeVisible(true);
|
||||
SetGhostsActive(true);
|
||||
SetPacManActive(true);
|
||||
|
||||
statusDisplay.SetExtraLivesDisplayVisible(true);
|
||||
statusDisplay.SetLevelDisplayVisible(true);
|
||||
statusDisplay.SetLabel1UPTextBlinking(true);
|
||||
|
||||
soundManager.SuppressSound(false);
|
||||
soundManager.StartGhostSound();
|
||||
|
||||
SetFrozen(false);
|
||||
}
|
||||
|
||||
public void SetFrozen(bool frozen, bool ghostIgnoreIfCaught = false, bool ghostKeepAnimating = false)
|
||||
{
|
||||
// Debug.Log($"{gameObject} Set Frozen: {frozen}");
|
||||
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)
|
||||
{
|
||||
if (eventType == NetworkEventType.TimeSequenceSync)
|
||||
if (eventType != NetworkEventType.FullSync)
|
||||
{
|
||||
data.Append(currentlyInTimeSequence, ref index);
|
||||
|
||||
if (currentlyInTimeSequence)
|
||||
{
|
||||
data.AppendAsByte((int)currentTimeSequence, ref index);
|
||||
data.Append(timeSequenceSecondsPassed, ref index);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//data[offset++] = new byte[] { NetworkManager.Int32ToByte((int)gameState) };
|
||||
//data[offset++] = BitConverter.GetBytes(currentlyInTimeSequence);
|
||||
//data[offset++] = new byte[] { NetworkManager.Int32ToByte((int)currentTimeSequence) };
|
||||
//data[offset++] = BitConverter.GetBytes(timeSequenceSecondsPassed);
|
||||
data.Append(gameState == PacManGameState.InGame, ref index);
|
||||
|
||||
data.AppendAsByte(level, ref index);
|
||||
data.Append(score, ref index);
|
||||
data.AppendAsByte(extraLives, ref index);
|
||||
|
||||
data.Append(currentlyInTimeSequence, ref index);
|
||||
|
||||
if (currentlyInTimeSequence)
|
||||
{
|
||||
data.AppendAsByte((int)currentTimeSequence, ref index);
|
||||
data.Append(timeSequenceSecondsPassed, ref index);
|
||||
}
|
||||
|
||||
bonusFruit.CollectSyncedData(data, ref index, eventType);
|
||||
|
||||
collisionManager.CollectSyncedData(data, ref index, eventType);
|
||||
|
||||
ghostManager.CollectSyncedData(data, ref index, eventType);
|
||||
|
||||
pacMan.CollectSyncedData(data, ref index, eventType);
|
||||
|
||||
soundManager.CollectSyncedData(data, ref index, eventType);
|
||||
}
|
||||
|
||||
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
@@ -422,30 +439,48 @@ namespace Marro.PacManUdon
|
||||
if (eventType == NetworkEventType.StartGameButtonPressed)
|
||||
{
|
||||
StartGameButtonPressed();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (eventType == NetworkEventType.TimeSequenceSync)
|
||||
if (eventType != NetworkEventType.FullSync)
|
||||
{
|
||||
var currentlyInTimeSequence = data.ReadBool(ref index);
|
||||
if (currentlyInTimeSequence)
|
||||
{
|
||||
var currentTimeSequence = (PacManTimeSequence)data.ReadByte(ref index);
|
||||
var timeSequenceSecondsPassed = data.ReadFloat(ref index);
|
||||
TimeSequenceSyncWithRemote(currentTimeSequence, timeSequenceSecondsPassed);
|
||||
}
|
||||
else
|
||||
{
|
||||
TimeSequenceTryEndCurrent();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//SetGameState((PacManGameState)data[offset++]);
|
||||
// If we're currently in-game, we'll need to make sure the state is setup correctly
|
||||
var remoteCurrentlyInGame = data.ReadBool(ref index);
|
||||
if (remoteCurrentlyInGame)
|
||||
{
|
||||
currentlyInTimeSequence = false; // Kill the current time sequence, otherwise it might interfere
|
||||
// No need to run it to completion since we're overriding all state
|
||||
SetupInGameState();
|
||||
}
|
||||
|
||||
//var currentlyInTimeSequence = BitConverter.ToBoolean(data, offset++);
|
||||
//var currentTimeSequence = (PacManTimeSequence)data[offset++];
|
||||
//var timeSequenceSecondsPassed = BitConverter.ToSingle(data, offset);
|
||||
//offset += 4;
|
||||
//TimeSequenceSyncWithRemote(currentlyInTimeSequence, currentTimeSequence, timeSequenceSecondsPassed);
|
||||
SetLevel(data.ReadByte(ref index));
|
||||
SetScore(data.ReadInt(ref index));
|
||||
SetExtraLives(data.ReadByte(ref index));
|
||||
|
||||
// Sync up with the remote's time sequence
|
||||
var remoteCurrentlyInTimeSequence = data.ReadBool(ref index);
|
||||
if (remoteCurrentlyInTimeSequence)
|
||||
{
|
||||
var currentTimeSequence = (PacManTimeSequence)data.ReadByte(ref index);
|
||||
var timeSequenceSecondsPassed = data.ReadFloat(ref index);
|
||||
TimeSequenceSyncWithRemote(currentTimeSequence, timeSequenceSecondsPassed);
|
||||
}
|
||||
|
||||
// Note that we don't have any logic for if the remote is not in-game and not in a time sequence.
|
||||
// Such a state should be impossible.
|
||||
|
||||
bonusFruit.WriteSyncedData(data, ref index, eventType);
|
||||
|
||||
collisionManager.WriteSyncedData(data, ref index, eventType);
|
||||
|
||||
ghostManager.WriteSyncedData(data, ref index, eventType);
|
||||
|
||||
pacMan.WriteSyncedData(data, ref index, eventType);
|
||||
|
||||
soundManager.WriteSyncedData(data, ref index, eventType);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,15 @@ namespace Marro.PacManUdon
|
||||
Special,
|
||||
}
|
||||
|
||||
enum PacManGhostAnimatorState
|
||||
{
|
||||
Normal,
|
||||
Caught,
|
||||
Scared,
|
||||
ScaredWhite,
|
||||
Special
|
||||
}
|
||||
|
||||
public enum PacManGhostState
|
||||
{
|
||||
Normal,
|
||||
@@ -68,6 +77,7 @@ namespace Marro.PacManUdon
|
||||
// State
|
||||
private PacManGhostState ghostState;
|
||||
private bool isScared;
|
||||
private bool whiteScared;
|
||||
private bool scattering;
|
||||
private PacManGhostFrozenState frozenState;
|
||||
|
||||
@@ -113,8 +123,6 @@ namespace Marro.PacManUdon
|
||||
|
||||
Index = index;
|
||||
|
||||
SubscribeToEvent(NetworkEventType.GhostUpdate);
|
||||
|
||||
targetIndicator.transform.parent = transform.parent;
|
||||
}
|
||||
|
||||
@@ -542,21 +550,20 @@ namespace Marro.PacManUdon
|
||||
SetAnimatorDirection((int)targetDirection);
|
||||
}
|
||||
|
||||
if (isScared) // Don't update ghost type while scared as this interrupts the white/blue blinking
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
PacManGhostType ghostType = this.ghostType;
|
||||
|
||||
if (specialLook)
|
||||
if (isScared)
|
||||
{
|
||||
ghostType = PacManGhostType.Special;
|
||||
ghostType = whiteScared ? PacManGhostType.ScaredWhite : PacManGhostType.Scared;
|
||||
}
|
||||
else if (ghostState == PacManGhostState.Returning || ghostState == PacManGhostState.Entering)
|
||||
{
|
||||
ghostType = PacManGhostType.Caught;
|
||||
}
|
||||
else if (specialLook)
|
||||
{
|
||||
ghostType = PacManGhostType.Special;
|
||||
}
|
||||
|
||||
SetAnimatorGhostType((int)ghostType);
|
||||
}
|
||||
@@ -593,18 +600,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);
|
||||
}
|
||||
else if (ghostState == PacManGhostState.Normal)
|
||||
{
|
||||
Debug.Log($"{gameObject} cought PacMan!");
|
||||
ghostManager.CapturedPacMan();
|
||||
//Debug.Log($"{gameObject} was cought!");
|
||||
ghostManager.GhostCaught(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
//Debug.Log($"{gameObject} cought PacMan!");
|
||||
ghostManager.CapturedPacMan();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Caught(int scoreBonus)
|
||||
@@ -668,13 +680,8 @@ namespace Marro.PacManUdon
|
||||
private void SetScared(bool scared)
|
||||
{
|
||||
isScared = scared;
|
||||
UpdateAnimator();
|
||||
SetWhite(false);
|
||||
UpdateSpeed();
|
||||
|
||||
if (isScared)
|
||||
{
|
||||
SetWhite(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetScattering(bool scattering, bool reverseDirection = true)
|
||||
@@ -695,25 +702,32 @@ 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;
|
||||
|
||||
if (oldFrozenState == PacManGhostFrozenState.FrozenIfNotCaught) // Catch animator up after not updating during FrozenIfNotCaught
|
||||
{
|
||||
UpdateAnimator();
|
||||
}
|
||||
var oldFrozenState = frozenState;
|
||||
frozenState = PacManGhostFrozenState.NotFrozen;
|
||||
|
||||
if (oldFrozenState == PacManGhostFrozenState.FrozenIfNotCaught) // Catch animator up after not updating during FrozenIfNotCaught
|
||||
{
|
||||
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)
|
||||
@@ -728,10 +742,8 @@ namespace Marro.PacManUdon
|
||||
|
||||
public void SetWhite(bool white)
|
||||
{
|
||||
if (!isScared || !gameObject.activeInHierarchy)
|
||||
return;
|
||||
|
||||
SetAnimatorGhostType(white ? (int)PacManGhostType.ScaredWhite : (int)PacManGhostType.Scared);
|
||||
whiteScared = white;
|
||||
UpdateAnimator();
|
||||
}
|
||||
|
||||
public void SetElroy(int elroyLevel)
|
||||
@@ -796,7 +808,7 @@ namespace Marro.PacManUdon
|
||||
|
||||
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
if (eventType != NetworkEventType.GhostUpdate)
|
||||
if (eventType != NetworkEventType.FullSync)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -810,8 +822,8 @@ namespace Marro.PacManUdon
|
||||
|
||||
data.AppendAsByte((int)ghostState, ref index);
|
||||
data.Append(isScared, ref index);
|
||||
data.Append(whiteScared, ref index);
|
||||
data.Append(scattering, ref index);
|
||||
data.AppendAsByte((int)frozenState, ref index);
|
||||
|
||||
data.Append(offGrid, ref index);
|
||||
data.AppendAsByte(housePelletCounter, ref index);
|
||||
@@ -819,11 +831,13 @@ namespace Marro.PacManUdon
|
||||
data.AppendAsByte(housePelletCounterLimit, ref index);
|
||||
|
||||
base.CollectSyncedData(data, ref index, eventType);
|
||||
|
||||
data.AppendAsByte((int)frozenState, ref index);
|
||||
}
|
||||
|
||||
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
if (eventType != NetworkEventType.GhostUpdate)
|
||||
if (eventType != NetworkEventType.FullSync)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -837,15 +851,23 @@ namespace Marro.PacManUdon
|
||||
|
||||
ghostState = (PacManGhostState)data.ReadByte(ref index);
|
||||
isScared = data.ReadBool(ref index);
|
||||
whiteScared = data.ReadBool(ref index);
|
||||
scattering = data.ReadBool(ref index);
|
||||
frozenState = (PacManGhostFrozenState)data.ReadByte(ref index);
|
||||
|
||||
offGrid = data.ReadBool(ref index);
|
||||
housePelletCounter = data.ReadByte(ref index);
|
||||
housePelletCounterActive = data.ReadBool(ref index);
|
||||
housePelletCounterLimit = data.ReadByte(ref index);
|
||||
|
||||
return base.WriteSyncedData(data, ref index, eventType);
|
||||
UpdateSpeed();
|
||||
|
||||
frozenState = PacManGhostFrozenState.NotFrozen; // Ensure UpdateAnimator runs fully
|
||||
|
||||
var success = base.WriteSyncedData(data, ref index, eventType);
|
||||
|
||||
frozenState = (PacManGhostFrozenState)data.ReadByte(ref index);
|
||||
|
||||
return success;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -74,13 +72,10 @@ namespace Marro.PacManUdon
|
||||
|
||||
ghosts[ghostIndex].Initialize(collisionManager, pacMan, blinky, startTransform, homePosition, idlePosition1, idlePosition2, cornerPosition, ghostIndex);
|
||||
}
|
||||
|
||||
SubscribeToEvent(NetworkEventType.GhostUpdate);
|
||||
}
|
||||
|
||||
public void RestartLevel(bool afterLifeLost = false)
|
||||
{
|
||||
ghostScaredQueue = new DataList();
|
||||
powerPelletActive = false;
|
||||
scatterCounter = 0;
|
||||
scatterPatternIndex = 0;
|
||||
@@ -100,10 +95,7 @@ namespace Marro.PacManUdon
|
||||
}
|
||||
|
||||
SetScattering(true, reverseDirection: false);
|
||||
}
|
||||
|
||||
public void NewLevel()
|
||||
{
|
||||
SetSharedPelletCounterActive(false);
|
||||
UpdateElroyLevel(collisionManager.PelletCount);
|
||||
foreach (Ghost ghost in ghosts)
|
||||
@@ -186,7 +178,7 @@ namespace Marro.PacManUdon
|
||||
}
|
||||
}
|
||||
|
||||
public void GhostCaughtQueue(Ghost ghost)
|
||||
public void GhostCaught(Ghost ghost)
|
||||
{
|
||||
if (gameController.GameState == PacManGameState.AttractMode)
|
||||
{
|
||||
@@ -194,34 +186,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);
|
||||
@@ -325,7 +289,7 @@ namespace Marro.PacManUdon
|
||||
for (int i = 0; i < ghosts.Length; i++)
|
||||
{
|
||||
ghosts[i].SetHousePelletCounterLimit(privatePelletCounterReleaseValues[i]);
|
||||
RestartLevel(); // Reset needed to properly apply level
|
||||
ghosts[i].UpdateSpeed();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -487,11 +451,6 @@ namespace Marro.PacManUdon
|
||||
|
||||
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
if (eventType != NetworkEventType.GhostUpdate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Power Pellet logic
|
||||
data.Append(powerPelletActive, ref index);
|
||||
data.Append(powerPelletCountdown, ref index);
|
||||
@@ -519,28 +478,14 @@ namespace Marro.PacManUdon
|
||||
|
||||
data.AppendAsByte(gameController.Level, ref index);
|
||||
|
||||
var ghostScaredQueueArray = new byte[ghosts.Length];
|
||||
for (int i = 0; i < ghostScaredQueueArray.Length; i++)
|
||||
foreach (var ghost in ghosts)
|
||||
{
|
||||
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;
|
||||
ghost.CollectSyncedData(data, ref index, eventType);
|
||||
}
|
||||
//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)
|
||||
{
|
||||
if (eventType != NetworkEventType.GhostUpdate)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Power Pellet logic
|
||||
powerPelletActive = data.ReadBool(ref index);
|
||||
powerPelletCountdown = data.ReadFloat(ref index);
|
||||
@@ -569,18 +514,10 @@ namespace Marro.PacManUdon
|
||||
var level = data.ReadByte(ref index);
|
||||
SetLevelConstants(level);
|
||||
|
||||
ghostScaredQueue.Clear();
|
||||
for (int i = 0; i < ghosts.Length; i++)
|
||||
foreach (var ghost in ghosts)
|
||||
{
|
||||
var ghostIndex = data[index + i];
|
||||
if (ghostIndex > ghosts.Length) // Reached terminator
|
||||
{
|
||||
break;
|
||||
}
|
||||
ghostScaredQueue.Add(ghosts[ghostIndex]);
|
||||
ghost.WriteSyncedData(data, ref index, eventType);
|
||||
}
|
||||
index += ghosts.Length;
|
||||
//Debug.Log($"{gameObject} Read back a ghostScareQueue of length {ghostScaredQueue.Count}");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -143,15 +143,5 @@ namespace Marro.PacManUdon
|
||||
{
|
||||
return (Vector2)transform.localPosition;
|
||||
}
|
||||
|
||||
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,9 +17,6 @@ namespace Marro.PacManUdon
|
||||
FullSync = 1,
|
||||
PacManTurn = 2,
|
||||
StartGameButtonPressed = 3,
|
||||
SyncPellets = 4,
|
||||
GhostUpdate = 5,
|
||||
TimeSequenceSync = 6,
|
||||
Pause = 7,
|
||||
Resume = 8,
|
||||
Step = 9,
|
||||
@@ -327,7 +324,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 +372,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 +498,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;
|
||||
}
|
||||
|
||||
@@ -544,13 +541,15 @@ namespace Marro.PacManUdon
|
||||
|
||||
InitializeEvent(eventType, timestamp, eventId, out byte[] data, out var index);
|
||||
|
||||
var subscibers = GetEventSubscribers(eventType);
|
||||
var effectiveEventType = eventType == NetworkEventType.FullSyncForced ? NetworkEventType.FullSync : eventType;
|
||||
|
||||
var subscibers = GetEventSubscribers(effectiveEventType);
|
||||
|
||||
if (subscibers != null)
|
||||
{
|
||||
foreach (var obj in subscibers)
|
||||
{
|
||||
obj.CollectSyncedData(data, ref index, eventType);
|
||||
obj.CollectSyncedData(data, ref index, effectiveEventType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -567,7 +566,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 +646,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 +665,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 +710,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 +797,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()
|
||||
@@ -838,11 +837,16 @@ namespace Marro.PacManUdon
|
||||
return false;
|
||||
}
|
||||
|
||||
if (eventType == NetworkEventType.FullSyncForced)
|
||||
{
|
||||
eventType = NetworkEventType.FullSync;
|
||||
}
|
||||
|
||||
var index = (int)HeaderLength; // Skip header
|
||||
|
||||
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 +882,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 +974,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()
|
||||
@@ -1192,22 +1196,7 @@ namespace Marro.PacManUdon
|
||||
|
||||
public void DoFullSync()
|
||||
{
|
||||
SendEventSoon(NetworkEventType.FullSync);
|
||||
}
|
||||
|
||||
public void DoPelletSync()
|
||||
{
|
||||
SendEventSoon(NetworkEventType.SyncPellets);
|
||||
}
|
||||
|
||||
public void DoGhostSync()
|
||||
{
|
||||
SendEventSoon(NetworkEventType.GhostUpdate);
|
||||
}
|
||||
|
||||
public void DoTimeSequenceSync()
|
||||
{
|
||||
SendEventSoon(NetworkEventType.TimeSequenceSync);
|
||||
SendEventSoon(NetworkEventType.FullSyncForced);
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
|
||||
@@ -43,7 +43,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 23
|
||||
Data: 22
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@@ -433,19 +433,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: defaultSpeed
|
||||
Data: animator
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: defaultSpeed
|
||||
Data: animator
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 25|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Single, mscorlib
|
||||
Data: UnityEngine.Animator, UnityEngine.AnimationModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -487,214 +487,16 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: powerPelletSpeed
|
||||
Data: renderer
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: powerPelletSpeed
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 25
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 25
|
||||
- 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: 28|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: speed
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: speed
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 25
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 25
|
||||
- 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: 30|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: startPosition
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: startPosition
|
||||
- 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: 32|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: animator
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: animator
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 34|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.Animator, UnityEngine.AnimationModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 34
|
||||
- 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: 35|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: renderer
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: renderer
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 37|System.RuntimeType, mscorlib
|
||||
Data: 28|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.Renderer, UnityEngine.CoreModule
|
||||
@@ -703,7 +505,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 37
|
||||
Data: 28
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -718,7 +520,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 38|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -739,25 +541,223 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: hideUntilUnfrozen
|
||||
Data: startPosition
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: hideUntilUnfrozen
|
||||
Data: startPosition
|
||||
- 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: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: defaultSpeed
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: defaultSpeed
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 40|System.RuntimeType, mscorlib
|
||||
Data: 33|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Boolean, mscorlib
|
||||
Data: System.Single, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 40
|
||||
Data: 33
|
||||
- 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: 34|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: powerPelletSpeed
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 35|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: powerPelletSpeed
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 33
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 33
|
||||
- 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: 36|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: state
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: state
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 38|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.PacManState, Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 11
|
||||
- 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: 39|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: speed
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: speed
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 33
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 33
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -793,19 +793,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: dead
|
||||
Data: freezeSeconds
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: dead
|
||||
Data: freezeSeconds
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 40
|
||||
Data: 33
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 40
|
||||
Data: 33
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -841,19 +841,73 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: kinematic
|
||||
Data: frozen
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: frozen
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 45|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Boolean, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 45
|
||||
- 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: 46|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: kinematic
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: kinematic
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 40
|
||||
Data: 45
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 40
|
||||
Data: 45
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -868,7 +922,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 45|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -892,16 +946,16 @@ MonoBehaviour:
|
||||
Data: followingPredefinedPath
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: followingPredefinedPath
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 40
|
||||
Data: 45
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 40
|
||||
Data: 45
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -916,7 +970,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 47|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -940,13 +994,13 @@ MonoBehaviour:
|
||||
Data: predefinedPath
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: predefinedPath
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 49|System.RuntimeType, mscorlib
|
||||
Data: 52|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.Direction[], Assembly-CSharp
|
||||
@@ -955,7 +1009,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 50|System.RuntimeType, mscorlib
|
||||
Data: 53|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Int32[], mscorlib
|
||||
@@ -976,7 +1030,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 51|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 54|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1000,7 +1054,7 @@ MonoBehaviour:
|
||||
Data: predefinedPathIndex
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 52|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: predefinedPathIndex
|
||||
@@ -1024,103 +1078,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 53|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: freezeSeconds
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: freezeSeconds
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 25
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 25
|
||||
- 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: 55|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: frozen
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 56|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: frozen
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 40
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 40
|
||||
- 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: 57|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1144,7 +1102,7 @@ MonoBehaviour:
|
||||
Data: animatorKeyState
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: animatorKeyState
|
||||
@@ -1168,7 +1126,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 58|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1192,7 +1150,7 @@ MonoBehaviour:
|
||||
Data: animatorKeyDirection
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 60|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: animatorKeyDirection
|
||||
@@ -1216,7 +1174,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 61|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 60|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
|
||||
@@ -12,29 +12,40 @@ namespace Marro.PacManUdon
|
||||
Dead,
|
||||
}
|
||||
|
||||
enum PacManState
|
||||
{
|
||||
Idle,
|
||||
Normal,
|
||||
PowerPellet,
|
||||
Dead,
|
||||
Big,
|
||||
}
|
||||
|
||||
[RequireComponent(typeof(Animator))]
|
||||
[RequireComponent(typeof(Renderer))]
|
||||
public class PacMan : GridMover
|
||||
{
|
||||
private PlayerInput input;
|
||||
private CollisionManager collisionManager;
|
||||
private Animator animator;
|
||||
private new Renderer renderer;
|
||||
|
||||
private Vector2 startPosition;
|
||||
private float defaultSpeed;
|
||||
private float powerPelletSpeed;
|
||||
|
||||
private PacManState state;
|
||||
|
||||
private float speed;
|
||||
private Vector2 startPosition;
|
||||
private Animator animator;
|
||||
new Renderer renderer;
|
||||
private bool hideUntilUnfrozen;
|
||||
private bool dead;
|
||||
private float freezeSeconds;
|
||||
private bool frozen;
|
||||
|
||||
private bool kinematic;
|
||||
|
||||
private bool followingPredefinedPath;
|
||||
private Direction[] predefinedPath;
|
||||
private int predefinedPathIndex;
|
||||
|
||||
private float freezeSeconds;
|
||||
private bool frozen;
|
||||
|
||||
private readonly int animatorKeyState = Animator.StringToHash("State");
|
||||
private readonly int animatorKeyDirection = Animator.StringToHash("Direction");
|
||||
|
||||
@@ -45,7 +56,6 @@ namespace Marro.PacManUdon
|
||||
animator = GetComponent<Animator>();
|
||||
renderer = GetComponent<Renderer>();
|
||||
frozen = false;
|
||||
hideUntilUnfrozen = false;
|
||||
startPosition = startTransform.localPosition;
|
||||
}
|
||||
|
||||
@@ -54,13 +64,13 @@ namespace Marro.PacManUdon
|
||||
SetPosition(startPosition);
|
||||
direction = Direction.Left;
|
||||
targetDirection = Direction.Left;
|
||||
speed = defaultSpeed;
|
||||
kinematic = false;
|
||||
followingPredefinedPath = false;
|
||||
|
||||
SetDead(false);
|
||||
state = PacManState.Idle;
|
||||
|
||||
SetAnimatorState((int)PacManAnimatorState.Idle);
|
||||
UpdateSpeed();
|
||||
UpdateAnimator();
|
||||
}
|
||||
|
||||
public override void SyncedUpdate()
|
||||
@@ -72,12 +82,6 @@ namespace Marro.PacManUdon
|
||||
return;
|
||||
}
|
||||
|
||||
if (hideUntilUnfrozen)
|
||||
{
|
||||
hideUntilUnfrozen = false;
|
||||
SetVisibility(true);
|
||||
}
|
||||
|
||||
float speed = this.speed;
|
||||
if (freezeSeconds > 0)
|
||||
{
|
||||
@@ -216,22 +220,23 @@ 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;
|
||||
|
||||
if (dead)
|
||||
switch (state)
|
||||
{
|
||||
SetAnimatorState((int)PacManAnimatorState.Dead);
|
||||
animator.speed = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
animator.speed = frozen ? 0 : 1;
|
||||
|
||||
if (frozen)
|
||||
{
|
||||
return;
|
||||
case PacManState.Dead:
|
||||
SetAnimatorState((int)PacManAnimatorState.Dead);
|
||||
animator.speed = 1;
|
||||
return;
|
||||
case PacManState.Idle:
|
||||
SetAnimatorState((int)PacManAnimatorState.Idle);
|
||||
return;
|
||||
case PacManState.Big:
|
||||
SetAnimatorState((int)PacManAnimatorState.Big);
|
||||
animator.speed = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (direction.Equals(Direction.Zero))
|
||||
@@ -241,8 +246,12 @@ namespace Marro.PacManUdon
|
||||
else
|
||||
{
|
||||
SetAnimatorState((int)PacManAnimatorState.Moving);
|
||||
SetAnimatorDirection((int)targetDirection);
|
||||
}
|
||||
|
||||
animator.speed = frozen ? 0 : 1;
|
||||
|
||||
SetAnimatorDirection((int)targetDirection);
|
||||
|
||||
}
|
||||
|
||||
private void SetAnimatorDirection(int value) =>
|
||||
@@ -251,22 +260,22 @@ namespace Marro.PacManUdon
|
||||
private void SetAnimatorState(int value) =>
|
||||
animator.SetFloat(animatorKeyState, value);
|
||||
|
||||
public void SetDead(bool dead)
|
||||
public void Die()
|
||||
{
|
||||
this.dead = dead;
|
||||
state = PacManState.Dead;
|
||||
UpdateAnimator();
|
||||
}
|
||||
|
||||
public void SetFrozen(bool frozen)
|
||||
{
|
||||
this.frozen = frozen;
|
||||
UpdateAnimator();
|
||||
}
|
||||
|
||||
public void HideUntilUnfrozen()
|
||||
{
|
||||
hideUntilUnfrozen = true;
|
||||
SetVisibility(false);
|
||||
if (!frozen && state == PacManState.Idle)
|
||||
{
|
||||
state = PacManState.Normal;
|
||||
}
|
||||
|
||||
UpdateAnimator();
|
||||
}
|
||||
|
||||
public void SetLevel(int level)
|
||||
@@ -278,7 +287,13 @@ namespace Marro.PacManUdon
|
||||
|
||||
public void SetPowerPellet(bool powerPellet)
|
||||
{
|
||||
if (powerPellet)
|
||||
state = powerPellet ? PacManState.PowerPellet : PacManState.Normal;
|
||||
UpdateSpeed();
|
||||
}
|
||||
|
||||
private void UpdateSpeed()
|
||||
{
|
||||
if (state == PacManState.PowerPellet)
|
||||
{
|
||||
speed = powerPelletSpeed;
|
||||
}
|
||||
@@ -312,12 +327,32 @@ namespace Marro.PacManUdon
|
||||
|
||||
public void BecomeBig()
|
||||
{
|
||||
SetAnimatorState((int)PacManAnimatorState.Big);
|
||||
state = PacManState.Big;
|
||||
UpdateAnimator();
|
||||
}
|
||||
|
||||
void SetVisibility(bool visible)
|
||||
public void SetVisibility(bool visible)
|
||||
{
|
||||
renderer.enabled = visible;
|
||||
}
|
||||
|
||||
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
data.AppendAsByte((int)state, ref index);
|
||||
data.Append(freezeSeconds, ref index);
|
||||
data.Append(frozen, ref index);
|
||||
|
||||
base.CollectSyncedData(data, ref index, eventType);
|
||||
}
|
||||
|
||||
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
state = (PacManState)data.ReadByte(ref index);
|
||||
freezeSeconds = data.ReadFloat(ref index);
|
||||
frozen = data.ReadBool(ref index);
|
||||
UpdateSpeed();
|
||||
|
||||
return base.WriteSyncedData(data, ref index, eventType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 10
|
||||
Data: 11
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@@ -217,25 +217,79 @@ 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: 9
|
||||
Data: 13
|
||||
- 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: 14|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: inputMethod
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 15|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: inputMethod
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 16|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.InputMethod, Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 14|System.RuntimeType, mscorlib
|
||||
Data: 17|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Int32, mscorlib
|
||||
@@ -256,7 +310,61 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 18|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: resultInput
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: resultInput
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 20|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.Direction, Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 17
|
||||
- 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: 21|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -280,16 +388,16 @@ MonoBehaviour:
|
||||
Data: inputHorizontal
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 16|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 22|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: inputHorizontal
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 13
|
||||
Data: 20
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 14
|
||||
Data: 17
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -304,7 +412,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 23|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -328,16 +436,16 @@ MonoBehaviour:
|
||||
Data: inputVertical
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: inputVertical
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 13
|
||||
Data: 20
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 14
|
||||
Data: 17
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -352,7 +460,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 25|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -376,13 +484,13 @@ MonoBehaviour:
|
||||
Data: horizontalValue
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 26|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: horizontalValue
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 21|System.RuntimeType, mscorlib
|
||||
Data: 27|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Single, mscorlib
|
||||
@@ -391,7 +499,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 21
|
||||
Data: 27
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -406,7 +514,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 22|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 28|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -430,16 +538,16 @@ MonoBehaviour:
|
||||
Data: verticalValue
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: verticalValue
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 21
|
||||
Data: 27
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 21
|
||||
Data: 27
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -454,7 +562,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 30|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -478,7 +586,7 @@ MonoBehaviour:
|
||||
Data: horizontalPriority
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: horizontalPriority
|
||||
@@ -502,61 +610,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 26|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: player
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: player
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 28|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.SDKBase.VRCPlayerApi, VRCSDKBase
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 28
|
||||
- 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: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 32|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
@@ -29,6 +39,34 @@
|
||||
SubscribeToEvent(NetworkEventType.PacManTurn);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (active)
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.R))
|
||||
{
|
||||
gameManager.ResetButtonPressed();
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.G))
|
||||
{
|
||||
gameManager.networkManager.DoFullSync();
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.C))
|
||||
{
|
||||
gameManager.JumpToTimeSequenceBoardClear();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.T))
|
||||
{
|
||||
gameManager.ResetButtonPressed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
Debug.Log($"{gameObject} got activated, {player} was immobilized");
|
||||
@@ -143,11 +181,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)
|
||||
{
|
||||
player.PlayHapticEventInHand(VRC_Pickup.PickupHand.Left, 0.1f, 0.15f, 75);
|
||||
if (inputMethod != InputMethod.KeyboardMouse)
|
||||
{
|
||||
player.PlayHapticEventInHand(VRC_Pickup.PickupHand.Left, 0.1f, 0.15f, 75);
|
||||
}
|
||||
|
||||
this.horizontalPriority = horizontalPriority;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: PowerPellet
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: bc9582994932aa648bc02c914215e7cc, type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
sourceCsScript: {fileID: 11500000, guid: 55d0efe8af4dba540a508287baca6656, type: 3}
|
||||
scriptVersion: 2
|
||||
compiledVersion: 2
|
||||
behaviourSyncMode: 0
|
||||
hasInteractEvent: 0
|
||||
scriptID: 7835090324168685075
|
||||
serializationData:
|
||||
SerializedFormat: 2
|
||||
SerializedBytes:
|
||||
ReferencedUnityObjects: []
|
||||
SerializedBytesString:
|
||||
Prefab: {fileID: 0}
|
||||
PrefabModificationsReferencedUnityObjects: []
|
||||
PrefabModifications: []
|
||||
SerializationNodes:
|
||||
- Name: fieldDefinitions
|
||||
Entry: 7
|
||||
Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition,
|
||||
UdonSharp.Editor]], mscorlib
|
||||
- Name: comparer
|
||||
Entry: 7
|
||||
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String,
|
||||
mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 896816ace5640c644bd057ab48c3b9a1
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace Marro.PacManUdon
|
||||
{
|
||||
using UdonSharp;
|
||||
|
||||
public class PowerPellet : UdonSharpBehaviour
|
||||
{
|
||||
// Oh how I wish I could just have this method extend pellet and do things the normal way...
|
||||
// But alas, with 'typeof', 'is' and overriding base fields all broken/not available I don't see a good way of differentiating between a type or its derivatives...
|
||||
// The only reason I even want to use this class is so I can do GetComponentsInChildren<PowerPellet> instead of gathering all Pellets and then sorting through them.
|
||||
// But since power pellets are the only pellets with animators, I'll probably just use GetComponentsInChildren<Animator> instead without further checking, since the animator is what I need to manipulate anyway.
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55d0efe8af4dba540a508287baca6656
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -14,7 +14,6 @@ namespace Marro.PacManUdon
|
||||
SetGameState(PacManGameState.AttractModeDemo);
|
||||
break;
|
||||
case 1:
|
||||
InitializeLevel();
|
||||
SetMazeVisible(true);
|
||||
SetLevel(1);
|
||||
break;
|
||||
@@ -323,7 +322,6 @@ namespace Marro.PacManUdon
|
||||
break;
|
||||
case 3:
|
||||
SetPelletsActive(true);
|
||||
collisionManager.RestoreAllPellets();
|
||||
statusDisplay.SetGameOverTextVisible(true);
|
||||
break;
|
||||
case 4:
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Marro.PacManUdon
|
||||
PrepareForCutscene();
|
||||
|
||||
SetGameState(PacManGameState.AttractMode);
|
||||
|
||||
|
||||
// Initialize
|
||||
soundManager.SuppressSound(true);
|
||||
attractScreen.gameObject.SetActive(true);
|
||||
@@ -92,7 +92,6 @@ namespace Marro.PacManUdon
|
||||
pacMan.SetPosition(attractScreenElements[16].transform.localPosition);
|
||||
pacMan.SetDirection(Direction.Left);
|
||||
|
||||
ghostManager.RestartLevel();
|
||||
ghostManager.SetLevel(2);
|
||||
ghostManager.SetKinematic(true);
|
||||
ghostManager.SetActive(true);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Marro.PacManUdon
|
||||
case 1:
|
||||
// Hide ghosts, start pacman death animation
|
||||
SetGhostsActive(false);
|
||||
pacMan.SetDead(true);
|
||||
pacMan.Die();
|
||||
break;
|
||||
case 2:
|
||||
// Start playing death sound
|
||||
|
||||
@@ -42,7 +42,6 @@ namespace Marro.PacManUdon
|
||||
SetFrozen(false);
|
||||
soundManager.SuppressSound(false);
|
||||
soundManager.StartGhostSound();
|
||||
soundManager.UpdatePelletCount(collisionManager.PelletCount - collisionManager.PelletCollectedCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ namespace Marro.PacManUdon
|
||||
gameState = PacManGameState.InGame;
|
||||
|
||||
InitializeNewGame();
|
||||
InitializeLevel();
|
||||
PrepareForCutscene();
|
||||
|
||||
soundManager.SuppressSound(false);
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace Marro.PacManUdon
|
||||
PrepareForCutscene();
|
||||
|
||||
// Reset, show maze and score display
|
||||
InitializeLevel();
|
||||
SetMazeVisible(true);
|
||||
statusDisplay.SetScoreDisplayVisible(true);
|
||||
statusDisplay.SetLabel1UPTextBlinking(true);
|
||||
break;
|
||||
case 1:
|
||||
// Increment level, show ready, show pellets, show lives indicators
|
||||
|
||||
@@ -42,7 +42,6 @@ namespace Marro.PacManUdon
|
||||
|
||||
jumpingToTimeSequence = true;
|
||||
TimeSequenceProgressToTime(100000f);
|
||||
|
||||
|
||||
if (waitingForTimeSequenceFinalize)
|
||||
{
|
||||
@@ -96,29 +95,29 @@ namespace Marro.PacManUdon
|
||||
private void TimeSequenceFinish(PacManTimeSequence timeSequence)
|
||||
{
|
||||
TimeSequenceExecuteFinalize(timeSequence);
|
||||
networkManager.SendEventSoon(NetworkEventType.TimeSequenceSync);
|
||||
if (!jumpingToTimeSequence)
|
||||
{
|
||||
TimeSequenceExecuteFinished(timeSequence);
|
||||
}
|
||||
}
|
||||
|
||||
private void TimeSequenceSyncWithRemote(PacManTimeSequence currentTimeSequence, float timeSequenceSecondsPassed)
|
||||
private void TimeSequenceSyncWithRemote(PacManTimeSequence remoteCurrentTimeSequence, float timeSequenceSecondsPassedRemote)
|
||||
{
|
||||
// If the remote is in a time sequence but we're not, or we're in a different time sequence, or if we're behind,
|
||||
// jump to the remote's time sequence.
|
||||
if (!currentlyInTimeSequence
|
||||
|| currentTimeSequence != this.currentTimeSequence
|
||||
|| timeSequenceSecondsPassed < this.timeSequenceSecondsPassed)
|
||||
// If our current time sequence state is incompatible with the remote time sequence, kill it
|
||||
if (currentlyInTimeSequence && remoteCurrentTimeSequence != currentTimeSequence
|
||||
|| timeSequenceSecondsPassedRemote < timeSequenceSecondsPassed)
|
||||
{
|
||||
StartTimeSequence(currentTimeSequence);
|
||||
currentlyInTimeSequence = false;
|
||||
}
|
||||
|
||||
// If we're (now) in a time sequence, jump our progress to match the one on the remote
|
||||
if (currentlyInTimeSequence)
|
||||
// If we're not/no longer in a time sequence, start the remote's time sequence
|
||||
if (!currentlyInTimeSequence)
|
||||
{
|
||||
TimeSequenceProgressToTime(timeSequenceSecondsPassed);
|
||||
StartTimeSequence(remoteCurrentTimeSequence);
|
||||
}
|
||||
|
||||
// Jump our progress to match the one on the remote
|
||||
TimeSequenceProgressToTime(timeSequenceSecondsPassedRemote);
|
||||
}
|
||||
|
||||
#region Events
|
||||
|
||||
@@ -1147,19 +1147,25 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _nextDotSound
|
||||
Data: alternatePelletSound
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _nextDotSound
|
||||
Data: alternatePelletSound
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 17
|
||||
Entry: 7
|
||||
Data: 66|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Boolean, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 17
|
||||
Data: 66
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1174,7 +1180,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 66|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
|
||||
@@ -1195,25 +1201,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _ghostRetreating
|
||||
Data: ghostRetreating
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _ghostRetreating
|
||||
Data: ghostRetreating
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 68|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Boolean, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
Entry: 9
|
||||
Data: 66
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 68
|
||||
Data: 66
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1249,19 +1249,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _ghostBlue
|
||||
Data: ghostBlue
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _ghostBlue
|
||||
Data: ghostBlue
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 68
|
||||
Data: 66
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 68
|
||||
Data: 66
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1297,13 +1297,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _ghostSoundLevel
|
||||
Data: ghostSoundLevel
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 72|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _ghostSoundLevel
|
||||
Data: ghostSoundLevel
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 73|System.RuntimeType, mscorlib
|
||||
@@ -1351,19 +1351,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _currentlyPlayingSiren
|
||||
Data: currentlyPlayingSiren
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 75|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _currentlyPlayingSiren
|
||||
Data: currentlyPlayingSiren
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 68
|
||||
Data: 66
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 68
|
||||
Data: 66
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1399,19 +1399,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: _suppress
|
||||
Data: suppress
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 77|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: _suppress
|
||||
Data: suppress
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 68
|
||||
Data: 66
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 68
|
||||
Data: 66
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
|
||||
using JetBrains.Annotations;
|
||||
using Marro.PacManUdon;
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon;
|
||||
|
||||
public class SoundManager : SyncedObject
|
||||
{
|
||||
@@ -30,13 +28,13 @@ public class SoundManager : SyncedObject
|
||||
[SerializeField] private AudioClip siren3;
|
||||
[SerializeField] private AudioClip siren4;
|
||||
|
||||
private AudioClip _nextDotSound;
|
||||
private bool _ghostRetreating;
|
||||
private bool _ghostBlue;
|
||||
private int _ghostSoundLevel;
|
||||
private bool _currentlyPlayingSiren;
|
||||
private bool alternatePelletSound;
|
||||
private bool ghostRetreating;
|
||||
private bool ghostBlue;
|
||||
private int ghostSoundLevel;
|
||||
private bool currentlyPlayingSiren;
|
||||
|
||||
private bool _suppress;
|
||||
private bool suppress;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
@@ -47,19 +45,19 @@ public class SoundManager : SyncedObject
|
||||
{
|
||||
StopAllSound();
|
||||
|
||||
_nextDotSound = pacDot2;
|
||||
alternatePelletSound = false;
|
||||
|
||||
_ghostRetreating = false;
|
||||
_ghostBlue = false;
|
||||
_ghostSoundLevel = 0;
|
||||
_currentlyPlayingSiren = false;
|
||||
ghostRetreating = false;
|
||||
ghostBlue = false;
|
||||
ghostSoundLevel = 0;
|
||||
currentlyPlayingSiren = false;
|
||||
|
||||
_suppress = true;
|
||||
suppress = true;
|
||||
}
|
||||
|
||||
public void SuppressSound(bool suppress)
|
||||
{
|
||||
_suppress = suppress;
|
||||
this.suppress = suppress;
|
||||
|
||||
if (suppress)
|
||||
{
|
||||
@@ -79,8 +77,8 @@ public class SoundManager : SyncedObject
|
||||
|
||||
public void PlayPelletSound()
|
||||
{
|
||||
PlaySound(audioSourcePacMan, _nextDotSound);
|
||||
_nextDotSound = _nextDotSound == pacDot1 ? pacDot2 : pacDot1;
|
||||
PlaySound(audioSourcePacMan, alternatePelletSound ? pacDot2 : pacDot1);
|
||||
alternatePelletSound = !alternatePelletSound;
|
||||
}
|
||||
|
||||
public void PlayDeathSound()
|
||||
@@ -115,13 +113,13 @@ public class SoundManager : SyncedObject
|
||||
|
||||
public void SetGhostBlue(bool isBlue)
|
||||
{
|
||||
_ghostBlue = isBlue;
|
||||
ghostBlue = isBlue;
|
||||
UpdateGhostSound();
|
||||
}
|
||||
|
||||
public void SetGhostRetreat(bool isRetreating)
|
||||
{
|
||||
_ghostRetreating = isRetreating;
|
||||
ghostRetreating = isRetreating;
|
||||
UpdateGhostSound();
|
||||
}
|
||||
|
||||
@@ -154,19 +152,19 @@ public class SoundManager : SyncedObject
|
||||
|
||||
// Debug.Log($"UpdatePelletCount: {pelletCount}, level: {level}");
|
||||
|
||||
if (_ghostSoundLevel >= level)
|
||||
if (ghostSoundLevel >= level)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_ghostSoundLevel = level;
|
||||
ghostSoundLevel = level;
|
||||
UpdateGhostSound();
|
||||
}
|
||||
|
||||
private void PlaySound(AudioSource audioSource, AudioClip audioClip, bool loop = false)
|
||||
{
|
||||
// Debug.Log($"PlaySound, audioSource: {audioSource}, audioClip: {audioClip}, loop: {loop}, suppress: {_suppress}");
|
||||
if (_suppress)
|
||||
if (suppress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -184,7 +182,7 @@ public class SoundManager : SyncedObject
|
||||
|
||||
private void SwitchSound(AudioSource audioSource, AudioClip audioClip, bool loop)
|
||||
{
|
||||
if (_suppress)
|
||||
if (suppress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -210,22 +208,22 @@ public class SoundManager : SyncedObject
|
||||
|
||||
private void UpdateGhostSound()
|
||||
{
|
||||
if (_ghostRetreating)
|
||||
if (ghostRetreating)
|
||||
{
|
||||
PlaySound(audioSourceGhosts, pacGhostRetreat, true);
|
||||
_currentlyPlayingSiren = false;
|
||||
currentlyPlayingSiren = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_ghostBlue)
|
||||
if (ghostBlue)
|
||||
{
|
||||
PlaySound(audioSourceGhosts, pacGhostBlue, true);
|
||||
_currentlyPlayingSiren = false;
|
||||
currentlyPlayingSiren = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var currentGhostLevelSound = GetSoundForGhostLevel(_ghostSoundLevel);
|
||||
if (_currentlyPlayingSiren)
|
||||
var currentGhostLevelSound = GetSoundForGhostLevel(ghostSoundLevel);
|
||||
if (currentlyPlayingSiren)
|
||||
{
|
||||
SwitchSound(audioSourceGhosts, currentGhostLevelSound, true);
|
||||
}
|
||||
@@ -234,7 +232,7 @@ public class SoundManager : SyncedObject
|
||||
PlaySound(audioSourceGhosts, currentGhostLevelSound, true);
|
||||
}
|
||||
|
||||
_currentlyPlayingSiren = true;
|
||||
currentlyPlayingSiren = true;
|
||||
}
|
||||
|
||||
private AudioClip GetSoundForGhostLevel(int ghostLevel)
|
||||
@@ -256,11 +254,23 @@ public class SoundManager : SyncedObject
|
||||
|
||||
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
|
||||
data.Append(alternatePelletSound, ref index);
|
||||
data.Append(ghostRetreating, ref index);
|
||||
data.Append(ghostBlue, ref index);
|
||||
data.AppendAsByte(ghostSoundLevel, ref index);
|
||||
data.Append(currentlyPlayingSiren, ref index);
|
||||
}
|
||||
|
||||
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
alternatePelletSound = data.ReadBool(ref index);
|
||||
ghostRetreating = data.ReadBool(ref index);
|
||||
ghostBlue = data.ReadBool(ref index);
|
||||
ghostSoundLevel = data.ReadByte(ref index);
|
||||
currentlyPlayingSiren = data.ReadBool(ref index);
|
||||
|
||||
UpdateGhostSound();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,15 +166,5 @@ namespace Marro.PacManUdon
|
||||
levelDisplayDigitAnimators[i].SetFloat("FruitType", PacManConstants.FruitTypeToValue(PacManConstants.GetFruitTypeForLevel(level - i)));
|
||||
}
|
||||
}
|
||||
|
||||
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
using System.Collections;
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using UdonSharp;
|
||||
|
||||
namespace Marro.PacManUdon
|
||||
{
|
||||
|
||||
@@ -1,178 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: Teleporter
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 1589eb7cce8925e4da3272208dfa87f4, type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
sourceCsScript: {fileID: 11500000, guid: aae1c5d18ae01b3488b54c72e6f1edf6, type: 3}
|
||||
scriptVersion: 2
|
||||
compiledVersion: 2
|
||||
behaviourSyncMode: 0
|
||||
hasInteractEvent: 0
|
||||
scriptID: -7788394196284941649
|
||||
serializationData:
|
||||
SerializedFormat: 2
|
||||
SerializedBytes:
|
||||
ReferencedUnityObjects: []
|
||||
SerializedBytesString:
|
||||
Prefab: {fileID: 0}
|
||||
PrefabModificationsReferencedUnityObjects: []
|
||||
PrefabModifications: []
|
||||
SerializationNodes:
|
||||
- Name: fieldDefinitions
|
||||
Entry: 7
|
||||
Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition,
|
||||
UdonSharp.Editor]], mscorlib
|
||||
- Name: comparer
|
||||
Entry: 7
|
||||
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String,
|
||||
mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 2
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: direction
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: direction
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 3|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.Direction, Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 4|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
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 6|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- 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: target
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 7|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: target
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 8|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: UnityEngine.Transform, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 8
|
||||
- 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: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 10|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6e306d768eba5b469eea599abcf4800
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,23 +0,0 @@
|
||||
namespace Marro.PacManUdon
|
||||
{
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
|
||||
public class Teleporter : UdonSharpBehaviour
|
||||
{
|
||||
[SerializeField] private Direction direction = Direction.Zero;
|
||||
[SerializeField] private Transform target;
|
||||
|
||||
void OnTriggerEnter(Collider other)
|
||||
{
|
||||
GridMover gridMover = other.gameObject.GetComponent<GridMover>();
|
||||
|
||||
if (gridMover == null || gridMover.GetDirection() != direction)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
gridMover.SetPosition(gridMover.GetPosition() + (Vector2)(target.localPosition - transform.localPosition));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aae1c5d18ae01b3488b54c72e6f1edf6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace Marro.PacManUdon
|
||||
{
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
|
||||
public class Test : UdonSharpBehaviour
|
||||
{
|
||||
[SerializeField] Pellet pellet;
|
||||
public void Start()
|
||||
{
|
||||
Debug.Log(pellet.enabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0227a738d77ab0849bdc9047b5b27c78
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,118 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3}
|
||||
m_Name: Test1
|
||||
m_EditorClassIdentifier:
|
||||
serializedUdonProgramAsset: {fileID: 11400000, guid: 6457f9f1332ac0742bdff23291631f30, type: 2}
|
||||
udonAssembly:
|
||||
assemblyError:
|
||||
sourceCsScript: {fileID: 11500000, guid: 0227a738d77ab0849bdc9047b5b27c78, type: 3}
|
||||
scriptVersion: 2
|
||||
compiledVersion: 2
|
||||
behaviourSyncMode: 0
|
||||
hasInteractEvent: 0
|
||||
scriptID: -4571266787425106669
|
||||
serializationData:
|
||||
SerializedFormat: 2
|
||||
SerializedBytes:
|
||||
ReferencedUnityObjects: []
|
||||
SerializedBytesString:
|
||||
Prefab: {fileID: 0}
|
||||
PrefabModificationsReferencedUnityObjects: []
|
||||
PrefabModifications: []
|
||||
SerializationNodes:
|
||||
- Name: fieldDefinitions
|
||||
Entry: 7
|
||||
Data: 0|System.Collections.Generic.Dictionary`2[[System.String, mscorlib],[UdonSharp.Compiler.FieldDefinition,
|
||||
UdonSharp.Editor]], mscorlib
|
||||
- Name: comparer
|
||||
Entry: 7
|
||||
Data: 1|System.Collections.Generic.GenericEqualityComparer`1[[System.String,
|
||||
mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: pellet
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: pellet
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 3|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: Marro.PacManUdon.Pellet, Assembly-CSharp
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 4|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.Udon.UdonBehaviour, VRC.Udon
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- 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: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 5|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 1
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data: 6|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 184e93443ec1bb24fa4e1db8b51405da
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,65 +0,0 @@
|
||||
// // Silly me for wanting to make the code neat, forgot this was Udon :)
|
||||
|
||||
// using System.Collections;
|
||||
// using System.Collections.Generic;
|
||||
// using UdonSharp;
|
||||
// using UnityEngine;
|
||||
|
||||
// public abstract class TimeSequence : UdonSharpBehaviour
|
||||
// {
|
||||
// [UdonSynced] float secondsPassed;
|
||||
// int sequenceProgress;
|
||||
// float[] sequenceTimeSeconds;
|
||||
|
||||
// protected TimeSequence(float[] sequenceTimeSeconds)
|
||||
// {
|
||||
// sequenceProgress = 0;
|
||||
// secondsPassed = 0;
|
||||
// this.sequenceTimeSeconds = sequenceTimeSeconds;
|
||||
// ProgressSequenceToTime(secondsPassed);
|
||||
// }
|
||||
|
||||
// public void ProgressInTime(float deltaSeconds)
|
||||
// {
|
||||
// ProgressSequenceToTime(secondsPassed + deltaSeconds);
|
||||
// }
|
||||
|
||||
// public void ProgressSequenceToTime(float seconds)
|
||||
// {
|
||||
// secondsPassed = seconds;
|
||||
// while (secondsPassed >= sequenceTimeSeconds[sequenceProgress])
|
||||
// {
|
||||
// sequenceProgress += 1;
|
||||
// SequenceStep(sequenceProgress);
|
||||
// }
|
||||
// }
|
||||
|
||||
// protected abstract void SequenceStep(int sequneceProgress);
|
||||
|
||||
// public static float[] DeltaToAbsolute(float[] delta)
|
||||
// {
|
||||
// if (delta.Length < 1)
|
||||
// {
|
||||
// return new float[0];
|
||||
// }
|
||||
|
||||
// float[] absolute = new float[delta.Length];
|
||||
// absolute[0] = delta[0];
|
||||
// for (int i = 1; i < delta.Length; i++)
|
||||
// {
|
||||
// absolute[i] = delta[i] + absolute[i-1];
|
||||
// }
|
||||
// return absolute;
|
||||
// }
|
||||
|
||||
// public int SequenceProgress
|
||||
// {
|
||||
// get => sequenceProgress;
|
||||
// }
|
||||
|
||||
// public float SecondsPassed
|
||||
// {
|
||||
// get => secondsPassed;
|
||||
// set => ProgressSequenceToTime(value);
|
||||
// }
|
||||
// }
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 789dbd838d9dd5645852b3bda8c5a161
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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