Compare commits
12 Commits
154c642cce
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a8b395b1d3 | |||
| d03d06b5a7 | |||
| 912be35172 | |||
| 1433b9bdfc | |||
| 9554d1c512 | |||
| c3a19cc53e | |||
| eef7084e21 | |||
| f2910d7506 | |||
| 9f86308d8a | |||
| 305a0ec3a1 | |||
| b68b3d1c25 | |||
| 3642006bb2 |
File diff suppressed because it is too large
Load Diff
@@ -82,12 +82,12 @@ namespace Marro.PacManUdon
|
|||||||
this.active = active;
|
this.active = active;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AppendSyncedData(byte[][] data, ref int index, NetworkEventType eventType)
|
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool SetSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
161
Assets/Scripts/ByteUtils.cs
Normal file
161
Assets/Scripts/ByteUtils.cs
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Marro.PacManUdon
|
||||||
|
{
|
||||||
|
public static class ByteUtils
|
||||||
|
{
|
||||||
|
public static void Append(this byte[] target, byte[] value, ref int index)
|
||||||
|
{
|
||||||
|
//Debug.Log($"ByteUtils Append {nameof(value)}.Length: {value.Length}, {nameof(target)}.Length : {target.Length}, {nameof(index)}: {index}");
|
||||||
|
Array.Copy(value, 0, target, index, value.Length);
|
||||||
|
index += value.Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Append(this byte[] target, byte value, ref int index) =>
|
||||||
|
target[index++] = value;
|
||||||
|
|
||||||
|
public static void Append(this byte[] target, sbyte value, ref int index) =>
|
||||||
|
target[index++] = (byte)value;
|
||||||
|
|
||||||
|
public static void Append(this byte[] target, bool value, ref int index) =>
|
||||||
|
target[index++] = value ? (byte)1 : (byte)0;
|
||||||
|
|
||||||
|
public static void Append(this byte[] target, ushort value, ref int index) =>
|
||||||
|
target.Append(BitConverter.GetBytes(value), ref index);
|
||||||
|
|
||||||
|
public static void Append(this byte[] target, short value, ref int index) =>
|
||||||
|
target.Append(BitConverter.GetBytes(value), ref index);
|
||||||
|
|
||||||
|
public static void Append(this byte[] target, uint value, ref int index) =>
|
||||||
|
target.Append(BitConverter.GetBytes(value), ref index);
|
||||||
|
|
||||||
|
public static void Append(this byte[] target, int value, ref int index) =>
|
||||||
|
target.Append(BitConverter.GetBytes(value), ref index);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Casts <paramref name="value"/> to a byte and then appends it.
|
||||||
|
/// Safer than doing <c>Append((byte)value, ref index)</c>, which can crash the Udonbehaviour.
|
||||||
|
/// </summary>
|
||||||
|
public static void AppendAsByte(this byte[] target, int value, ref int index) =>
|
||||||
|
target.Append(value.ToByte(), ref index);
|
||||||
|
|
||||||
|
public static void Append(this byte[] target, ulong value, ref int index) =>
|
||||||
|
target.Append(BitConverter.GetBytes(value), ref index);
|
||||||
|
|
||||||
|
public static void Append(this byte[] target, long value, ref int index) =>
|
||||||
|
target.Append(BitConverter.GetBytes(value), ref index);
|
||||||
|
|
||||||
|
public static void Append(this byte[] target, float value, ref int index) =>
|
||||||
|
target.Append(BitConverter.GetBytes(value), ref index);
|
||||||
|
|
||||||
|
public static void Append(this byte[] target, double value, ref int index) =>
|
||||||
|
target.Append(BitConverter.GetBytes(value), ref index);
|
||||||
|
|
||||||
|
public static void Append(this byte[] target, char value, ref int index) =>
|
||||||
|
target.Append(BitConverter.GetBytes(value), ref index);
|
||||||
|
|
||||||
|
public static void Append(this byte[] target, Vector2 value, ref int index)
|
||||||
|
{
|
||||||
|
target.Append(value.x, ref index);
|
||||||
|
target.Append(value.y, ref index);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Append(this byte[] target, Vector3 value, ref int index)
|
||||||
|
{
|
||||||
|
target.Append(value.x, ref index);
|
||||||
|
target.Append(value.y, ref index);
|
||||||
|
target.Append(value.z, ref index);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static byte ReadByte(this byte[] source, ref int index) =>
|
||||||
|
source[index++];
|
||||||
|
|
||||||
|
public static bool ReadBool(this byte[] source, ref int index) =>
|
||||||
|
source[index++] > 0;
|
||||||
|
|
||||||
|
public static ushort ReadUShort(this byte[] source, ref int index)
|
||||||
|
{
|
||||||
|
var value = BitConverter.ToUInt16(source, index);
|
||||||
|
index += 2;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static short ReadShort(this byte[] source, ref int index)
|
||||||
|
{
|
||||||
|
var value = BitConverter.ToInt16(source, (int)index);
|
||||||
|
index += 2;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static uint ReadUInt(this byte[] source, ref int index)
|
||||||
|
{
|
||||||
|
var value = BitConverter.ToUInt32(source, index);
|
||||||
|
index += 4;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int ReadInt(this byte[] source, ref int index)
|
||||||
|
{
|
||||||
|
var value = BitConverter.ToInt32(source, index);
|
||||||
|
index += 4;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ulong ReadULong(this byte[] source, ref int index)
|
||||||
|
{
|
||||||
|
var value = BitConverter.ToUInt64(source, index);
|
||||||
|
index += 8;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long ReadLong(this byte[] source, ref int index)
|
||||||
|
{
|
||||||
|
var value = BitConverter.ToInt64(source, index);
|
||||||
|
index += 8;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static float ReadFloat(this byte[] source, ref int index)
|
||||||
|
{
|
||||||
|
var value = BitConverter.ToSingle(source, index);
|
||||||
|
index += 4;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static double ReadDouble(this byte[] source, ref int index)
|
||||||
|
{
|
||||||
|
var value = BitConverter.ToDouble(source, index);
|
||||||
|
index += 8;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static char ReadChar(this byte[] source, ref int index)
|
||||||
|
{
|
||||||
|
var value = BitConverter.ToChar(source, index);
|
||||||
|
index += 2;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Vector2 ReadVector2(this byte[] source, ref int index)
|
||||||
|
{
|
||||||
|
var value = new Vector2(BitConverter.ToSingle(source, index), BitConverter.ToSingle(source, index + 4));
|
||||||
|
index += 8;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Vector3 ReadVector3(this byte[] source, ref int index)
|
||||||
|
{
|
||||||
|
var value = new Vector3(BitConverter.ToSingle(source, index), BitConverter.ToSingle(source, index + 4), BitConverter.ToSingle(source, index + 8));
|
||||||
|
index += 12;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Casts an Int32 to a byte.
|
||||||
|
/// Doing this inline sometimes causes an udon exception, but doing it via a separate method seems to work fine.
|
||||||
|
/// </summary>
|
||||||
|
public static byte ToByte(this int value) =>
|
||||||
|
(byte)value;
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/ByteUtils.cs.meta
Normal file
11
Assets/Scripts/ByteUtils.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7d2126e683a87e241ad0399cefcda807
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -43,7 +43,7 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 37
|
Data: 34
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data:
|
Data:
|
||||||
@@ -1423,79 +1423,16 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: pelletCountOverride
|
Data: maze
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 86|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 86|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
|
||||||
Entry: 1
|
|
||||||
Data: pelletCountOverride
|
|
||||||
- Name: <UserType>k__BackingField
|
|
||||||
Entry: 9
|
|
||||||
Data: 15
|
|
||||||
- Name: <SystemType>k__BackingField
|
|
||||||
Entry: 9
|
|
||||||
Data: 15
|
|
||||||
- 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: 87|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
|
||||||
- Name:
|
|
||||||
Entry: 12
|
|
||||||
Data: 2
|
|
||||||
- Name:
|
|
||||||
Entry: 7
|
|
||||||
Data: 88|UnityEngine.TooltipAttribute, UnityEngine.CoreModule
|
|
||||||
- Name: tooltip
|
|
||||||
Entry: 1
|
|
||||||
Data: Override amount of pellets needed to clear stage, set to -1 to disable.
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name:
|
|
||||||
Entry: 7
|
|
||||||
Data: 89|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: maze
|
|
||||||
- Name: $v
|
|
||||||
Entry: 7
|
|
||||||
Data: 90|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: maze
|
Data: maze
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 91|System.RuntimeType, mscorlib
|
Data: 87|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: Marro.PacManUdon.Maze, Assembly-CSharp
|
Data: Marro.PacManUdon.Maze, Assembly-CSharp
|
||||||
@@ -1519,7 +1456,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 92|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 88|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -1543,13 +1480,13 @@ MonoBehaviour:
|
|||||||
Data: intermission2Pole
|
Data: intermission2Pole
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 93|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 89|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: intermission2Pole
|
Data: intermission2Pole
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 94|System.RuntimeType, mscorlib
|
Data: 90|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: Marro.PacManUdon.Intermission2Pole, Assembly-CSharp
|
Data: Marro.PacManUdon.Intermission2Pole, Assembly-CSharp
|
||||||
@@ -1573,7 +1510,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 95|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 91|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -1597,7 +1534,7 @@ MonoBehaviour:
|
|||||||
Data: mazeSpriteAnimator
|
Data: mazeSpriteAnimator
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 96|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 92|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: mazeSpriteAnimator
|
Data: mazeSpriteAnimator
|
||||||
@@ -1621,7 +1558,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 97|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 93|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -1642,19 +1579,25 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: pelletCountTotal
|
Data: attractScreenElements
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 98|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 94|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: pelletCountTotal
|
Data: attractScreenElements
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 9
|
Entry: 7
|
||||||
Data: 15
|
Data: 95|System.RuntimeType, mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 1
|
||||||
|
Data: UnityEngine.GameObject[], UnityEngine.CoreModule
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 15
|
Data: 95
|
||||||
- Name: <SyncMode>k__BackingField
|
- Name: <SyncMode>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
@@ -1669,7 +1612,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 99|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 96|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -1690,16 +1633,70 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: pelletCountRemaining
|
Data: intermissionScreenElements
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 100|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 97|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: pelletCountRemaining
|
Data: intermissionScreenElements
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 15
|
Data: 95
|
||||||
|
- Name: <SystemType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 95
|
||||||
|
- 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: 98|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: gameState
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 99|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: gameState
|
||||||
|
- Name: <UserType>k__BackingField
|
||||||
|
Entry: 7
|
||||||
|
Data: 100|System.RuntimeType, mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 1
|
||||||
|
Data: Marro.PacManUdon.PacManGameState, Assembly-CSharp
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 15
|
Data: 15
|
||||||
@@ -1739,25 +1736,19 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: attractScreenElements
|
Data: score
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 102|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 102|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: attractScreenElements
|
Data: score
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 7
|
Entry: 9
|
||||||
Data: 103|System.RuntimeType, mscorlib
|
Data: 15
|
||||||
- Name:
|
|
||||||
Entry: 1
|
|
||||||
Data: UnityEngine.GameObject[], UnityEngine.CoreModule
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 103
|
Data: 15
|
||||||
- Name: <SyncMode>k__BackingField
|
- Name: <SyncMode>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
@@ -1772,7 +1763,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 104|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
Data: 103|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
||||||
mscorlib
|
mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
@@ -1794,19 +1785,19 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: intermissionScreenElements
|
Data: level
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 105|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 104|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: intermissionScreenElements
|
Data: level
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 103
|
Data: 15
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 103
|
Data: 15
|
||||||
- Name: <SyncMode>k__BackingField
|
- Name: <SyncMode>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
@@ -1821,7 +1812,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 106|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
Data: 105|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
||||||
mscorlib
|
mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
@@ -1843,22 +1834,65 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: gameState
|
Data: highScore
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 107|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 106|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: gameState
|
Data: highScore
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 15
|
||||||
|
- Name: <SystemType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 15
|
||||||
|
- Name: <SyncMode>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 108|System.RuntimeType, mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 6
|
||||||
Data: Marro.PacManUdon.PacManGameState, Assembly-CSharp
|
Data:
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
|
- Name: <IsSerialized>k__BackingField
|
||||||
|
Entry: 5
|
||||||
|
Data: false
|
||||||
|
- Name: _fieldAttributes
|
||||||
|
Entry: 7
|
||||||
|
Data: 107|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: extraLives
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 108|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: extraLives
|
||||||
|
- Name: <UserType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 15
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 15
|
Data: 15
|
||||||
@@ -1893,250 +1927,6 @@ MonoBehaviour:
|
|||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
- Name:
|
|
||||||
Entry: 7
|
|
||||||
Data:
|
|
||||||
- Name: $k
|
|
||||||
Entry: 1
|
|
||||||
Data: score
|
|
||||||
- Name: $v
|
|
||||||
Entry: 7
|
|
||||||
Data: 110|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
|
||||||
- Name: <Name>k__BackingField
|
|
||||||
Entry: 1
|
|
||||||
Data: score
|
|
||||||
- Name: <UserType>k__BackingField
|
|
||||||
Entry: 9
|
|
||||||
Data: 15
|
|
||||||
- Name: <SystemType>k__BackingField
|
|
||||||
Entry: 9
|
|
||||||
Data: 15
|
|
||||||
- Name: <SyncMode>k__BackingField
|
|
||||||
Entry: 7
|
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
|
||||||
- Name:
|
|
||||||
Entry: 3
|
|
||||||
Data: 1
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name: <IsSerialized>k__BackingField
|
|
||||||
Entry: 5
|
|
||||||
Data: false
|
|
||||||
- Name: _fieldAttributes
|
|
||||||
Entry: 7
|
|
||||||
Data: 111|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
|
||||||
mscorlib
|
|
||||||
- Name:
|
|
||||||
Entry: 12
|
|
||||||
Data: 2
|
|
||||||
- Name:
|
|
||||||
Entry: 7
|
|
||||||
Data: 112|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name:
|
|
||||||
Entry: 7
|
|
||||||
Data: 113|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
|
|
||||||
- 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: level
|
|
||||||
- Name: $v
|
|
||||||
Entry: 7
|
|
||||||
Data: 114|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
|
||||||
- Name: <Name>k__BackingField
|
|
||||||
Entry: 1
|
|
||||||
Data: level
|
|
||||||
- Name: <UserType>k__BackingField
|
|
||||||
Entry: 9
|
|
||||||
Data: 15
|
|
||||||
- Name: <SystemType>k__BackingField
|
|
||||||
Entry: 9
|
|
||||||
Data: 15
|
|
||||||
- Name: <SyncMode>k__BackingField
|
|
||||||
Entry: 7
|
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
|
||||||
- Name:
|
|
||||||
Entry: 3
|
|
||||||
Data: 1
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name: <IsSerialized>k__BackingField
|
|
||||||
Entry: 5
|
|
||||||
Data: false
|
|
||||||
- Name: _fieldAttributes
|
|
||||||
Entry: 7
|
|
||||||
Data: 115|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
|
||||||
mscorlib
|
|
||||||
- Name:
|
|
||||||
Entry: 12
|
|
||||||
Data: 2
|
|
||||||
- Name:
|
|
||||||
Entry: 7
|
|
||||||
Data: 116|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name:
|
|
||||||
Entry: 7
|
|
||||||
Data: 117|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
|
|
||||||
- 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: highScore
|
|
||||||
- Name: $v
|
|
||||||
Entry: 7
|
|
||||||
Data: 118|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
|
||||||
- Name: <Name>k__BackingField
|
|
||||||
Entry: 1
|
|
||||||
Data: highScore
|
|
||||||
- Name: <UserType>k__BackingField
|
|
||||||
Entry: 9
|
|
||||||
Data: 15
|
|
||||||
- Name: <SystemType>k__BackingField
|
|
||||||
Entry: 9
|
|
||||||
Data: 15
|
|
||||||
- Name: <SyncMode>k__BackingField
|
|
||||||
Entry: 7
|
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
|
||||||
- Name:
|
|
||||||
Entry: 3
|
|
||||||
Data: 1
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name: <IsSerialized>k__BackingField
|
|
||||||
Entry: 5
|
|
||||||
Data: false
|
|
||||||
- Name: _fieldAttributes
|
|
||||||
Entry: 7
|
|
||||||
Data: 119|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
|
||||||
mscorlib
|
|
||||||
- Name:
|
|
||||||
Entry: 12
|
|
||||||
Data: 2
|
|
||||||
- Name:
|
|
||||||
Entry: 7
|
|
||||||
Data: 120|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name:
|
|
||||||
Entry: 7
|
|
||||||
Data: 121|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
|
|
||||||
- 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: extraLives
|
|
||||||
- Name: $v
|
|
||||||
Entry: 7
|
|
||||||
Data: 122|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
|
||||||
- Name: <Name>k__BackingField
|
|
||||||
Entry: 1
|
|
||||||
Data: extraLives
|
|
||||||
- Name: <UserType>k__BackingField
|
|
||||||
Entry: 9
|
|
||||||
Data: 15
|
|
||||||
- Name: <SystemType>k__BackingField
|
|
||||||
Entry: 9
|
|
||||||
Data: 15
|
|
||||||
- Name: <SyncMode>k__BackingField
|
|
||||||
Entry: 7
|
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
|
||||||
- Name:
|
|
||||||
Entry: 3
|
|
||||||
Data: 1
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name: <IsSerialized>k__BackingField
|
|
||||||
Entry: 5
|
|
||||||
Data: false
|
|
||||||
- Name: _fieldAttributes
|
|
||||||
Entry: 7
|
|
||||||
Data: 123|System.Collections.Generic.List`1[[System.Attribute, mscorlib]],
|
|
||||||
mscorlib
|
|
||||||
- Name:
|
|
||||||
Entry: 12
|
|
||||||
Data: 2
|
|
||||||
- Name:
|
|
||||||
Entry: 7
|
|
||||||
Data: 124|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name:
|
|
||||||
Entry: 7
|
|
||||||
Data: 125|UdonSharp.FieldChangeCallbackAttribute, UdonSharp.Runtime
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name:
|
|
||||||
Entry: 13
|
|
||||||
Data:
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 13
|
Entry: 13
|
||||||
Data:
|
Data:
|
||||||
|
|||||||
@@ -22,27 +22,22 @@ namespace Marro.PacManUdon
|
|||||||
|
|
||||||
[SerializeField] private GameObject recorder;
|
[SerializeField] private GameObject recorder;
|
||||||
|
|
||||||
|
|
||||||
[Header("Game settings")]
|
[Header("Game settings")]
|
||||||
[SerializeField] private int startingExtraLives = 3;
|
[SerializeField] private int startingExtraLives = 3;
|
||||||
[SerializeField] private int scoreToExtraLife = 10000;
|
[SerializeField] private int scoreToExtraLife = 10000;
|
||||||
[Tooltip("Override amount of pellets needed to clear stage, set to -1 to disable.")]
|
|
||||||
[SerializeField] private int pelletCountOverride = -1;
|
|
||||||
|
|
||||||
private Maze maze;
|
private Maze maze;
|
||||||
private Intermission2Pole intermission2Pole;
|
private Intermission2Pole intermission2Pole;
|
||||||
|
|
||||||
private Animator mazeSpriteAnimator;
|
private Animator mazeSpriteAnimator;
|
||||||
private int pelletCountTotal;
|
|
||||||
private int pelletCountRemaining;
|
|
||||||
private GameObject[] attractScreenElements;
|
private GameObject[] attractScreenElements;
|
||||||
private GameObject[] intermissionScreenElements;
|
private GameObject[] intermissionScreenElements;
|
||||||
|
|
||||||
private PacManGameState gameState;
|
private PacManGameState gameState;
|
||||||
[UdonSynced, FieldChangeCallback(nameof(Score))] private int score;
|
private int score;
|
||||||
[UdonSynced, FieldChangeCallback(nameof(Level))] private int level;
|
private int level;
|
||||||
[UdonSynced, FieldChangeCallback(nameof(HighScore))] private int highScore;
|
private int highScore;
|
||||||
[UdonSynced, FieldChangeCallback(nameof(ExtraLives))] private int extraLives;
|
private int extraLives;
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
@@ -63,7 +58,7 @@ namespace Marro.PacManUdon
|
|||||||
intermission2Pole = intermissionScreenElements[4].GetComponent<Intermission2Pole>();
|
intermission2Pole = intermissionScreenElements[4].GetComponent<Intermission2Pole>();
|
||||||
|
|
||||||
networkManager.Initialize();
|
networkManager.Initialize();
|
||||||
ghostManager.Initialize(maze.ghostStarts, maze.ghostTargets, pacMan, this);
|
ghostManager.Initialize(maze.ghostStarts, maze.ghostTargets, pacMan, pelletManager, this);
|
||||||
pacMan.Initialize(playerInput, maze.pacManStart, this);
|
pacMan.Initialize(playerInput, maze.pacManStart, this);
|
||||||
bonusFruit.Initialize();
|
bonusFruit.Initialize();
|
||||||
pelletManager.Initialize();
|
pelletManager.Initialize();
|
||||||
@@ -138,27 +133,20 @@ namespace Marro.PacManUdon
|
|||||||
{
|
{
|
||||||
Debug.Log($"{gameObject} New level started!");
|
Debug.Log($"{gameObject} New level started!");
|
||||||
|
|
||||||
pelletCountTotal = pelletManager.PelletCount;
|
|
||||||
pelletCountRemaining = pelletCountTotal;
|
|
||||||
ghostManager.SetPelletsRemaining(pelletCountRemaining);
|
|
||||||
ghostManager.NewLevel();
|
|
||||||
|
|
||||||
pelletManager.RestoreAllPellets();
|
pelletManager.RestoreAllPellets();
|
||||||
|
|
||||||
if (pelletCountOverride > 0)
|
ghostManager.NewLevel();
|
||||||
{
|
|
||||||
pelletCountRemaining = pelletCountOverride;
|
|
||||||
}
|
|
||||||
mazeSpriteAnimator.SetBool("Blinking", false);
|
mazeSpriteAnimator.SetBool("Blinking", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RestartLevel()
|
private void RestartLevel(bool afterLifeLost = false)
|
||||||
{
|
{
|
||||||
Debug.Log($"{gameObject} (Re)started level!");
|
Debug.Log($"{gameObject} (Re)started level!");
|
||||||
|
|
||||||
// SetInGameComponentVisibility(true);
|
// SetInGameComponentVisibility(true);
|
||||||
|
|
||||||
ghostManager.Reset();
|
ghostManager.RestartLevel(afterLifeLost);
|
||||||
pacMan.Reset();
|
pacMan.Reset();
|
||||||
bonusFruit.Despawn();
|
bonusFruit.Despawn();
|
||||||
soundManager.Reset();
|
soundManager.Reset();
|
||||||
@@ -172,29 +160,31 @@ namespace Marro.PacManUdon
|
|||||||
SetFrozen(true);
|
SetFrozen(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GotPellet(bool addScore = true)
|
public void GotPellet(Pellet pellet, bool addScore = true)
|
||||||
{
|
{
|
||||||
pelletCountRemaining--;
|
var pelletCollectedCount = pelletManager.PelletCollected(pellet);
|
||||||
|
|
||||||
if (addScore) AddScore(10);
|
if (addScore) AddScore(10);
|
||||||
|
|
||||||
ghostManager.PelletConsumed();
|
ghostManager.PelletConsumed();
|
||||||
|
|
||||||
soundManager.PlayPelletSound();
|
soundManager.PlayPelletSound();
|
||||||
|
|
||||||
|
var pelletCountRemaining = pelletManager.PelletCount - pelletCollectedCount;
|
||||||
|
|
||||||
soundManager.UpdatePelletCount(pelletCountRemaining);
|
soundManager.UpdatePelletCount(pelletCountRemaining);
|
||||||
|
|
||||||
int pelletsConsumed = pelletCountTotal - pelletCountRemaining;
|
|
||||||
if (pelletCountRemaining <= 0)
|
if (pelletCountRemaining <= 0)
|
||||||
{
|
{
|
||||||
StartTimeSequence(PacManTimeSequence.BoardClear);
|
StartTimeSequence(PacManTimeSequence.BoardClear);
|
||||||
}
|
}
|
||||||
else if (pelletsConsumed == 70 || pelletsConsumed == 170)
|
else if (pelletCollectedCount == 70 || pelletCollectedCount == 170)
|
||||||
{
|
{
|
||||||
bonusFruit.Spawn();
|
bonusFruit.Spawn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GotPowerPellet()
|
public void GotPowerPellet(Pellet pellet)
|
||||||
{
|
{
|
||||||
Debug.Log($"{gameObject} GotPowerPellet");
|
Debug.Log($"{gameObject} GotPowerPellet");
|
||||||
|
|
||||||
@@ -203,7 +193,7 @@ namespace Marro.PacManUdon
|
|||||||
TimeSequenceSkipToNextStep();
|
TimeSequenceSkipToNextStep();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GotPellet(addScore: false);
|
GotPellet(pellet, addScore: false);
|
||||||
AddScore(50);
|
AddScore(50);
|
||||||
ghostManager.SetPowerPellet(true);
|
ghostManager.SetPowerPellet(true);
|
||||||
pacMan.SetPowerPellet(true);
|
pacMan.SetPowerPellet(true);
|
||||||
@@ -240,7 +230,8 @@ namespace Marro.PacManUdon
|
|||||||
|
|
||||||
public void PacManCaught()
|
public void PacManCaught()
|
||||||
{
|
{
|
||||||
//StartTimeSequence(PacManTimeSequence.PacManCaught);
|
return;
|
||||||
|
StartTimeSequence(PacManTimeSequence.PacManCaught);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void NoGhostsScared()
|
public void NoGhostsScared()
|
||||||
@@ -403,7 +394,7 @@ namespace Marro.PacManUdon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AppendSyncedData(byte[][] data, ref int offset, NetworkEventType eventType)
|
public override void CollectSyncedData(byte[] data, ref int offset, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
//data[offset++] = new byte[] { NetworkManager.Int32ToByte((int)gameState) };
|
//data[offset++] = new byte[] { NetworkManager.Int32ToByte((int)gameState) };
|
||||||
//data[offset++] = BitConverter.GetBytes(currentlyInTimeSequence);
|
//data[offset++] = BitConverter.GetBytes(currentlyInTimeSequence);
|
||||||
@@ -411,7 +402,7 @@ namespace Marro.PacManUdon
|
|||||||
//data[offset++] = BitConverter.GetBytes(timeSequenceSecondsPassed);
|
//data[offset++] = BitConverter.GetBytes(timeSequenceSecondsPassed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool SetSyncedData(byte[] data, ref int offset, NetworkEventType eventType)
|
public override bool WriteSyncedData(byte[] data, ref int offset, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
if (eventType == NetworkEventType.StartGameButtonPressed)
|
if (eventType == NetworkEventType.StartGameButtonPressed)
|
||||||
{
|
{
|
||||||
@@ -429,58 +420,8 @@ namespace Marro.PacManUdon
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int ExtraLives
|
public PacManGameState GameState => gameState;
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
SetExtraLives(value);
|
|
||||||
}
|
|
||||||
get => extraLives;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PacManGameState GameState
|
public int Level => level;
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
SetGameState(value);
|
|
||||||
}
|
|
||||||
get => gameState;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool GhostsScared
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
get => GhostsScared;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Score
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
SetScore(value);
|
|
||||||
}
|
|
||||||
get => score;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int HighScore
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
SetHighScore(value);
|
|
||||||
}
|
|
||||||
get => score;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Level
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
SetLevel(value);
|
|
||||||
}
|
|
||||||
get => level;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -32,11 +32,14 @@ namespace Marro.PacManUdon
|
|||||||
TargetingIdlePosition2
|
TargetingIdlePosition2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[RequireComponent(typeof(Renderer))]
|
||||||
|
[RequireComponent(typeof(Animator))]
|
||||||
public class Ghost : GridMover
|
public class Ghost : GridMover
|
||||||
{
|
{
|
||||||
[SerializeField] private PacManGhostType ghostType;
|
[SerializeField] private PacManGhostType ghostType;
|
||||||
[SerializeField] private PacManGhostStartState startState;
|
[SerializeField] private PacManGhostStartState startState;
|
||||||
|
|
||||||
|
// External references
|
||||||
private GhostManager ghostManager;
|
private GhostManager ghostManager;
|
||||||
private Animator animator;
|
private Animator animator;
|
||||||
private new Renderer renderer;
|
private new Renderer renderer;
|
||||||
@@ -52,33 +55,40 @@ namespace Marro.PacManUdon
|
|||||||
private Vector2 idlePosition2;
|
private Vector2 idlePosition2;
|
||||||
private Vector2 cornerPosition;
|
private Vector2 cornerPosition;
|
||||||
|
|
||||||
private bool kinematic;
|
// Pathfinding
|
||||||
|
private Vector2 target;
|
||||||
private bool horizontalOnly;
|
private bool horizontalOnly;
|
||||||
private int housePelletCounterLimit;
|
private bool inTunnel;
|
||||||
|
private int rngState;
|
||||||
|
private bool turnAroundSoon;
|
||||||
|
|
||||||
|
private float speed;
|
||||||
|
|
||||||
|
// State
|
||||||
|
private PacManGhostState ghostState;
|
||||||
|
private bool isScared;
|
||||||
|
private bool scattering;
|
||||||
|
private PacManGhostFrozenState frozenState;
|
||||||
|
|
||||||
|
// Home
|
||||||
|
private bool offGrid;
|
||||||
|
private int housePelletCounter;
|
||||||
|
private bool housePelletCounterActive;
|
||||||
|
private int housePelletCounterLimit;
|
||||||
private bool faceInStartingDirectionUntilUnfrozen;
|
private bool faceInStartingDirectionUntilUnfrozen;
|
||||||
|
|
||||||
|
// Cutscene
|
||||||
|
private bool kinematic;
|
||||||
private bool specialLook;
|
private bool specialLook;
|
||||||
|
|
||||||
private bool followingPredefinedPath;
|
private bool followingPredefinedPath;
|
||||||
private Vector2[] predefinedPath;
|
private Vector2[] predefinedPath;
|
||||||
private int predefinedPathIndex;
|
private int predefinedPathIndex;
|
||||||
|
|
||||||
int rngState;
|
public bool IsScared => isScared;
|
||||||
private float speed;
|
public int Index { get; private set; }
|
||||||
private Vector2 target;
|
|
||||||
private bool offGrid;
|
|
||||||
private bool inTunnel;
|
|
||||||
private PacManGhostState ghostState;
|
|
||||||
private bool isScared;
|
|
||||||
private bool scattering;
|
|
||||||
private PacManGhostFrozenState frozenState;
|
|
||||||
private bool hideUntilUnfrozen;
|
|
||||||
private int housePelletCounter;
|
|
||||||
private bool housePelletCounterActive;
|
|
||||||
private bool turnAroundSoon;
|
|
||||||
|
|
||||||
public void Initialize(PacMan pacMan, Ghost blinky, Transform startTransform, Vector2 homePosition, Vector2 idlePosition1, Vector2 idlePosition2, Vector2 cornerPosition)
|
public void Initialize(PacMan pacMan, Ghost blinky, Transform startTransform, Vector2 homePosition, Vector2 idlePosition1, Vector2 idlePosition2, Vector2 cornerPosition, int index)
|
||||||
{
|
{
|
||||||
ghostManager = transform.parent.GetComponent<GhostManager>();
|
ghostManager = transform.parent.GetComponent<GhostManager>();
|
||||||
animator = GetComponent<Animator>();
|
animator = GetComponent<Animator>();
|
||||||
@@ -97,6 +107,8 @@ namespace Marro.PacManUdon
|
|||||||
startRotation = startTransform.localRotation;
|
startRotation = startTransform.localRotation;
|
||||||
|
|
||||||
frozenState = PacManGhostFrozenState.Frozen;
|
frozenState = PacManGhostFrozenState.Frozen;
|
||||||
|
|
||||||
|
Index = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
@@ -137,12 +149,8 @@ namespace Marro.PacManUdon
|
|||||||
|
|
||||||
public override void SyncedUpdate()
|
public override void SyncedUpdate()
|
||||||
{
|
{
|
||||||
if (ghostType == PacManGhostType.Blinky)
|
|
||||||
{
|
|
||||||
// ghostManager.gameStateManager.statusDisplay.SetDebugText(2, $"{turnAroundSoon}");
|
|
||||||
}
|
|
||||||
if (frozenState == PacManGhostFrozenState.Frozen ||
|
if (frozenState == PacManGhostFrozenState.Frozen ||
|
||||||
(frozenState == PacManGhostFrozenState.FrozenIfNotCaught && ((ghostState != PacManGhostState.Returning && ghostState != PacManGhostState.Entering) || hideUntilUnfrozen)))
|
(frozenState == PacManGhostFrozenState.FrozenIfNotCaught && ghostState != PacManGhostState.Returning && ghostState != PacManGhostState.Entering))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -160,9 +168,10 @@ namespace Marro.PacManUdon
|
|||||||
if (turnAroundSoon && ghostState == PacManGhostState.Normal
|
if (turnAroundSoon && ghostState == PacManGhostState.Normal
|
||||||
&& GridMoverTools.CrossesTileBorder(position, nextPosition, direction.x != 0, direction.y != 0))
|
&& GridMoverTools.CrossesTileBorder(position, nextPosition, direction.x != 0, direction.y != 0))
|
||||||
{
|
{
|
||||||
// Debug.Log($"{gameObject} turned around");
|
|
||||||
SetDirection(direction * -1);
|
SetDirection(direction * -1);
|
||||||
|
Debug.Log($"{gameObject} turned around to direction {GetDirection()}");
|
||||||
turnAroundSoon = false;
|
turnAroundSoon = false;
|
||||||
|
return nextPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kinematic)
|
if (kinematic)
|
||||||
@@ -224,6 +233,12 @@ namespace Marro.PacManUdon
|
|||||||
// Debug.Log($"{gameObject} crossed tile center {gridPosition}, new target: {target}, new direction: {direction}");
|
// Debug.Log($"{gameObject} crossed tile center {gridPosition}, new target: {target}, new direction: {direction}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var distance = Vector2.Distance(position, nextPosition);
|
||||||
|
if (distance > 0.5f)
|
||||||
|
{
|
||||||
|
Debug.LogError($"{gameObject} Just jumped by distance {distance}! position: {position}, nextPosition: {nextPosition}, direction: {direction}, offGrid: {offGrid}, ghostState: {ghostState}");
|
||||||
|
}
|
||||||
|
|
||||||
return nextPosition;
|
return nextPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -642,7 +657,7 @@ namespace Marro.PacManUdon
|
|||||||
if (reverseDirection && this.scattering != scattering)
|
if (reverseDirection && this.scattering != scattering)
|
||||||
{
|
{
|
||||||
if (ghostState == PacManGhostState.Normal || ghostState == PacManGhostState.Home || ghostState == PacManGhostState.Exiting
|
if (ghostState == PacManGhostState.Normal || ghostState == PacManGhostState.Home || ghostState == PacManGhostState.Exiting
|
||||||
// This is afaik not normal PacMan behaviour, but is needed to accomidate slight timing differences
|
// This is afaik not normal PacMan behaviour, but is needed to accomidate slight timing differences during the demo
|
||||||
|| ghostState == PacManGhostState.Entering && ghostManager.gameController.GameState == PacManGameState.AttractModeDemo
|
|| ghostState == PacManGhostState.Entering && ghostManager.gameController.GameState == PacManGameState.AttractModeDemo
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -755,14 +770,69 @@ namespace Marro.PacManUdon
|
|||||||
return ghostState;
|
return ghostState;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsScared => isScared;
|
|
||||||
|
|
||||||
public void SetSpeed(float speed)
|
public void SetSpeed(float speed)
|
||||||
{
|
{
|
||||||
this.speed = speed;
|
this.speed = speed;
|
||||||
UpdateAnimator();
|
UpdateAnimator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
|
{
|
||||||
|
if (eventType != NetworkEventType.GhostUpdate)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
data.Append(target, ref index);
|
||||||
|
data.Append(horizontalOnly, ref index);
|
||||||
|
data.Append(inTunnel, ref index);
|
||||||
|
data.Append(rngState, ref index);
|
||||||
|
data.Append(turnAroundSoon, ref index);
|
||||||
|
data.Append(speed, ref index);
|
||||||
|
|
||||||
|
data.AppendAsByte((int)ghostState, ref index);
|
||||||
|
data.Append(isScared, ref index);
|
||||||
|
data.Append(scattering, ref index);
|
||||||
|
data.AppendAsByte((int)frozenState, ref index);
|
||||||
|
|
||||||
|
data.Append(offGrid, ref index);
|
||||||
|
data.AppendAsByte(housePelletCounter, ref index);
|
||||||
|
data.Append(housePelletCounterActive, ref index);
|
||||||
|
data.AppendAsByte(housePelletCounterLimit, ref index);
|
||||||
|
data.Append(faceInStartingDirectionUntilUnfrozen, ref index);
|
||||||
|
|
||||||
|
base.CollectSyncedData(data, ref index, eventType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
|
{
|
||||||
|
if (eventType != NetworkEventType.GhostUpdate)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
target = data.ReadVector2(ref index);
|
||||||
|
horizontalOnly = data.ReadBool(ref index);
|
||||||
|
inTunnel = data.ReadBool(ref index);
|
||||||
|
rngState = data.ReadInt(ref index);
|
||||||
|
turnAroundSoon = data.ReadBool(ref index);
|
||||||
|
Debug.Log($"{gameObject} turnAroundSoon = {turnAroundSoon}");
|
||||||
|
speed = data.ReadFloat(ref index);
|
||||||
|
|
||||||
|
ghostState = (PacManGhostState)data.ReadByte(ref index);
|
||||||
|
isScared = 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);
|
||||||
|
faceInStartingDirectionUntilUnfrozen = data.ReadBool(ref index);
|
||||||
|
|
||||||
|
return base.WriteSyncedData(data, ref index, eventType);
|
||||||
|
}
|
||||||
|
|
||||||
void OnTriggerEnter(Collider other)
|
void OnTriggerEnter(Collider other)
|
||||||
{
|
{
|
||||||
if (other.gameObject.GetComponent<PacManGhostCollider>())
|
if (other.gameObject.GetComponent<PacManGhostCollider>())
|
||||||
@@ -799,14 +869,5 @@ namespace Marro.PacManUdon
|
|||||||
SetInTunnel(false);
|
SetInTunnel(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PacManGhostState State
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
SetState(value);
|
|
||||||
}
|
|
||||||
get => ghostState;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -7,9 +7,12 @@ namespace Marro.PacManUdon
|
|||||||
public class GhostManager : SyncedObject
|
public class GhostManager : SyncedObject
|
||||||
{
|
{
|
||||||
[NonSerialized] public GameManager gameController;
|
[NonSerialized] public GameManager gameController;
|
||||||
|
|
||||||
private Ghost[] ghosts;
|
private Ghost[] ghosts;
|
||||||
private Ghost blinky;
|
private Ghost blinky;
|
||||||
|
|
||||||
|
private PelletManager pelletManager;
|
||||||
|
|
||||||
// Level constants
|
// Level constants
|
||||||
private float speedDefault;
|
private float speedDefault;
|
||||||
private float speedScared;
|
private float speedScared;
|
||||||
@@ -21,9 +24,12 @@ namespace Marro.PacManUdon
|
|||||||
private int elroy1PelletCount;
|
private int elroy1PelletCount;
|
||||||
private int elroy2PelletCount;
|
private int elroy2PelletCount;
|
||||||
|
|
||||||
|
private float powerPelletDuration;
|
||||||
|
private float[] scatterPattern;
|
||||||
|
private float pelletTimeoutLimit;
|
||||||
|
|
||||||
// Power Pellet logic
|
// Power Pellet logic
|
||||||
private bool powerPelletActive;
|
private bool powerPelletActive;
|
||||||
private float powerPelletDuration;
|
|
||||||
private float powerPelletCountdown;
|
private float powerPelletCountdown;
|
||||||
private int powerPelletMultiplier;
|
private int powerPelletMultiplier;
|
||||||
|
|
||||||
@@ -37,27 +43,25 @@ namespace Marro.PacManUdon
|
|||||||
|
|
||||||
// Scattering logic
|
// Scattering logic
|
||||||
private float scatterCounter;
|
private float scatterCounter;
|
||||||
private float[] scatterPattern;
|
|
||||||
private int scatterPatternIndex;
|
private int scatterPatternIndex;
|
||||||
|
|
||||||
// Elroy logic
|
// Elroy logic
|
||||||
public int elroyLevel;
|
public int elroyLevel;
|
||||||
private int pelletsRemaining;
|
|
||||||
|
|
||||||
// Ghost house logic
|
// Ghost house logic
|
||||||
private bool sharedPelletCounterActive;
|
private bool sharedPelletCounterActive;
|
||||||
private int sharedPelletCounter;
|
private int sharedPelletCounter;
|
||||||
private readonly int[] sharedPelletCounterReleaseValues = { 0, 7, 17, 32 };
|
private readonly int[] sharedPelletCounterReleaseValues = { 0, 7, 17, 32 };
|
||||||
private float pelletTimeout;
|
private float pelletTimeout;
|
||||||
private float pelletTimeoutLimit;
|
|
||||||
|
|
||||||
private bool frozen;
|
private bool frozen;
|
||||||
private bool kinematic;
|
private bool kinematic;
|
||||||
|
|
||||||
// This should be called once when the game is initialized
|
public void Initialize(Transform[] ghostStarts, Transform[] ghostTargets, PacMan pacMan, PelletManager pelletManager, GameManager gameController)
|
||||||
public void Initialize(Transform[] ghostStarts, Transform[] ghostTargets, PacMan pacMan, GameManager gameController)
|
|
||||||
{
|
{
|
||||||
this.gameController = gameController;
|
this.gameController = gameController;
|
||||||
|
this.pelletManager = pelletManager;
|
||||||
|
|
||||||
ghosts = transform.GetComponentsInChildren<Ghost>(true);
|
ghosts = transform.GetComponentsInChildren<Ghost>(true);
|
||||||
blinky = ghosts[0];
|
blinky = ghosts[0];
|
||||||
for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++)
|
for (int ghostIndex = 0; ghostIndex < ghosts.Length; ghostIndex++)
|
||||||
@@ -68,12 +72,11 @@ namespace Marro.PacManUdon
|
|||||||
Vector2 idlePosition2 = ghostTargets[2 + ghostIndex * 3].localPosition;
|
Vector2 idlePosition2 = ghostTargets[2 + ghostIndex * 3].localPosition;
|
||||||
Vector2 cornerPosition = ghostTargets[3 + ghostIndex * 3].localPosition;
|
Vector2 cornerPosition = ghostTargets[3 + ghostIndex * 3].localPosition;
|
||||||
|
|
||||||
ghosts[ghostIndex].Initialize(pacMan, blinky, startTransform, homePosition, idlePosition1, idlePosition2, cornerPosition);
|
ghosts[ghostIndex].Initialize(pacMan, blinky, startTransform, homePosition, idlePosition1, idlePosition2, cornerPosition, ghostIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This should be called every time the level is reset
|
public void RestartLevel(bool afterLifeLost = false)
|
||||||
public void Reset()
|
|
||||||
{
|
{
|
||||||
ghostScaredQueue = new DataList();
|
ghostScaredQueue = new DataList();
|
||||||
powerPelletActive = false;
|
powerPelletActive = false;
|
||||||
@@ -84,6 +87,11 @@ namespace Marro.PacManUdon
|
|||||||
elroyLevel = 0;
|
elroyLevel = 0;
|
||||||
kinematic = false;
|
kinematic = false;
|
||||||
|
|
||||||
|
if (afterLifeLost)
|
||||||
|
{
|
||||||
|
SetSharedPelletCounterActive(true);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (Ghost ghost in ghosts)
|
foreach (Ghost ghost in ghosts)
|
||||||
{
|
{
|
||||||
ghost.Reset();
|
ghost.Reset();
|
||||||
@@ -95,20 +103,15 @@ namespace Marro.PacManUdon
|
|||||||
public void NewLevel()
|
public void NewLevel()
|
||||||
{
|
{
|
||||||
SetSharedPelletCounterActive(false);
|
SetSharedPelletCounterActive(false);
|
||||||
|
UpdateElroyLevel();
|
||||||
foreach (Ghost ghost in ghosts)
|
foreach (Ghost ghost in ghosts)
|
||||||
{
|
{
|
||||||
ghost.ResetHousePelletCounter();
|
ghost.ResetHousePelletCounter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LifeLost()
|
|
||||||
{
|
|
||||||
SetSharedPelletCounterActive(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void SyncedUpdate()
|
public override void SyncedUpdate()
|
||||||
{
|
{
|
||||||
// gameStateManager.statusDisplay.SetDebugText(1, this.blinkCountdown.ToString());
|
|
||||||
if (frozen || kinematic)
|
if (frozen || kinematic)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -188,7 +191,10 @@ namespace Marro.PacManUdon
|
|||||||
gameController.GhostCaught(0);
|
gameController.GhostCaught(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Debug.Log($"{gameObject} GhostCaughtQueue with ghost {ghost}");
|
// Debug.Log($"{gameObject} GhostCaughtQueue with ghost {ghost}");
|
||||||
|
//networkManager.SendEventSoon(NetworkEventType.GhostUpdate);
|
||||||
|
|
||||||
ghostScaredQueue.Add(ghost);
|
ghostScaredQueue.Add(ghost);
|
||||||
GhostCaughtExecute(ghost);
|
GhostCaughtExecute(ghost);
|
||||||
}
|
}
|
||||||
@@ -310,6 +316,18 @@ namespace Marro.PacManUdon
|
|||||||
public void SetLevel(int level)
|
public void SetLevel(int level)
|
||||||
{
|
{
|
||||||
Debug.Log($"GhostManager: SetLevel {level}");
|
Debug.Log($"GhostManager: SetLevel {level}");
|
||||||
|
SetLevelConstants(level);
|
||||||
|
|
||||||
|
int[] privatePelletCounterReleaseValues = PacManConstants.GetGhostHousePrivatePelletCounterLimitForLevel(level);
|
||||||
|
for (int i = 0; i < ghosts.Length; i++)
|
||||||
|
{
|
||||||
|
ghosts[i].SetHousePelletCounterLimit(privatePelletCounterReleaseValues[i]);
|
||||||
|
RestartLevel(); // Reset needed to properly apply level
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetLevelConstants(int level)
|
||||||
|
{
|
||||||
speedDefault = PacManConstants.GetGhostDefaultSpeedForLevel(level);
|
speedDefault = PacManConstants.GetGhostDefaultSpeedForLevel(level);
|
||||||
speedScared = PacManConstants.GetGhostScaredSpeedForLevel(level);
|
speedScared = PacManConstants.GetGhostScaredSpeedForLevel(level);
|
||||||
speedReturn = 15f;
|
speedReturn = 15f;
|
||||||
@@ -322,13 +340,6 @@ namespace Marro.PacManUdon
|
|||||||
powerPelletDuration = PacManConstants.GetScaredDurationForLevel(level);
|
powerPelletDuration = PacManConstants.GetScaredDurationForLevel(level);
|
||||||
scatterPattern = PacManConstants.GetScatterPatternForLevel(level);
|
scatterPattern = PacManConstants.GetScatterPatternForLevel(level);
|
||||||
pelletTimeoutLimit = PacManConstants.GetGhostHousePelletTimeoutLimitForLevel(level);
|
pelletTimeoutLimit = PacManConstants.GetGhostHousePelletTimeoutLimitForLevel(level);
|
||||||
|
|
||||||
int[] privatePelletCounterReleaseValues = PacManConstants.GetGhostHousePrivatePelletCounterLimitForLevel(level);
|
|
||||||
for (int i = 0; i < ghosts.Length; i++)
|
|
||||||
{
|
|
||||||
ghosts[i].SetHousePelletCounterLimit(privatePelletCounterReleaseValues[i]);
|
|
||||||
Reset(); // Reset needed to properly apply level
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float GetTargetSpeed(Ghost ghost, PacManGhostState ghostState, bool isScared, bool inTunnel)
|
public float GetTargetSpeed(Ghost ghost, PacManGhostState ghostState, bool isScared, bool inTunnel)
|
||||||
@@ -368,7 +379,7 @@ namespace Marro.PacManUdon
|
|||||||
Debug.Log($"{gameObject} SetScattering: {scattering}");
|
Debug.Log($"{gameObject} SetScattering: {scattering}");
|
||||||
foreach (Ghost ghost in ghosts)
|
foreach (Ghost ghost in ghosts)
|
||||||
{
|
{
|
||||||
if (ghost == blinky && pelletsRemaining <= elroy1PelletCount)
|
if (ghost == blinky && elroyLevel > 0) // Once blinky is elroy he no longer scatters
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -376,15 +387,13 @@ namespace Marro.PacManUdon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPelletsRemaining(int pelletsRemaining)
|
/// <summary>
|
||||||
{
|
/// Whether to use the shared pellet counter for ghost exiting.
|
||||||
this.pelletsRemaining = pelletsRemaining;
|
/// Should be called before ghosts are reset.
|
||||||
UpdateElroyLevel();
|
/// </summary>
|
||||||
}
|
|
||||||
|
|
||||||
void SetSharedPelletCounterActive(bool active)
|
void SetSharedPelletCounterActive(bool active)
|
||||||
{
|
{
|
||||||
// Debug.Log($"{gameObject} SetSharedPelletCounterActive {active}");
|
Debug.Log($"{gameObject} SetSharedPelletCounterActive {active}");
|
||||||
sharedPelletCounterActive = active;
|
sharedPelletCounterActive = active;
|
||||||
foreach (Ghost ghost in ghosts)
|
foreach (Ghost ghost in ghosts)
|
||||||
{
|
{
|
||||||
@@ -394,10 +403,10 @@ namespace Marro.PacManUdon
|
|||||||
|
|
||||||
public void PelletConsumed()
|
public void PelletConsumed()
|
||||||
{
|
{
|
||||||
SetPelletsRemaining(pelletsRemaining - 1);
|
|
||||||
|
|
||||||
pelletTimeout = 0;
|
pelletTimeout = 0;
|
||||||
|
|
||||||
|
UpdateElroyLevel();
|
||||||
|
|
||||||
if (sharedPelletCounterActive)
|
if (sharedPelletCounterActive)
|
||||||
{
|
{
|
||||||
IncrementSharedPelletCounter();
|
IncrementSharedPelletCounter();
|
||||||
@@ -411,6 +420,7 @@ namespace Marro.PacManUdon
|
|||||||
void IncrementSharedPelletCounter()
|
void IncrementSharedPelletCounter()
|
||||||
{
|
{
|
||||||
sharedPelletCounter++;
|
sharedPelletCounter++;
|
||||||
|
//Debug.Log($"Incremented shared pellet counter to {sharedPelletCounter}");
|
||||||
for (int ghostIndex = 0; ghostIndex < sharedPelletCounterReleaseValues.Length; ghostIndex++)
|
for (int ghostIndex = 0; ghostIndex < sharedPelletCounterReleaseValues.Length; ghostIndex++)
|
||||||
{
|
{
|
||||||
Ghost ghost = ghosts[ghostIndex];
|
Ghost ghost = ghosts[ghostIndex];
|
||||||
@@ -442,10 +452,13 @@ namespace Marro.PacManUdon
|
|||||||
void UpdateElroyLevel()
|
void UpdateElroyLevel()
|
||||||
{
|
{
|
||||||
// Debug.Log($"{gameObject} Updating Elroy Level with pelletsRemaining {pelletsRemaining} with elroy2PelletCount {elroy2PelletCount} and elroy1PelletCount {elroy1PelletCount}");
|
// Debug.Log($"{gameObject} Updating Elroy Level with pelletsRemaining {pelletsRemaining} with elroy2PelletCount {elroy2PelletCount} and elroy1PelletCount {elroy1PelletCount}");
|
||||||
int oldElroyLevel = elroyLevel;
|
var oldElroyLevel = elroyLevel;
|
||||||
|
|
||||||
|
var pelletsRemaining = pelletManager.PelletCount - pelletManager.PelletCollectedCount;
|
||||||
if (pelletsRemaining < elroy2PelletCount) elroyLevel = 2;
|
if (pelletsRemaining < elroy2PelletCount) elroyLevel = 2;
|
||||||
else if (pelletsRemaining < elroy1PelletCount) elroyLevel = 1;
|
else if (pelletsRemaining < elroy1PelletCount) elroyLevel = 1;
|
||||||
else elroyLevel = 0;
|
else elroyLevel = 0;
|
||||||
|
|
||||||
if (elroyLevel != oldElroyLevel)
|
if (elroyLevel != oldElroyLevel)
|
||||||
{
|
{
|
||||||
blinky.SetElroy(elroyLevel);
|
blinky.SetElroy(elroyLevel);
|
||||||
@@ -470,13 +483,103 @@ namespace Marro.PacManUdon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AppendSyncedData(byte[][] data, ref int index, NetworkEventType eventType)
|
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
|
if (eventType != NetworkEventType.GhostUpdate)
|
||||||
|
{
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool SetSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
// Power Pellet logic
|
||||||
|
data.Append(powerPelletActive, ref index);
|
||||||
|
data.Append(powerPelletCountdown, ref index);
|
||||||
|
data.AppendAsByte(powerPelletMultiplier, ref index);
|
||||||
|
|
||||||
|
// Blink logic
|
||||||
|
data.Append(blinkingActivated, ref index);
|
||||||
|
data.Append(blinkCountdown, ref index);
|
||||||
|
data.Append(blinkCurrentlyWhite, ref index);
|
||||||
|
|
||||||
|
// Scattering logic
|
||||||
|
data.Append(scatterCounter, ref index);
|
||||||
|
data.AppendAsByte(scatterPatternIndex, ref index);
|
||||||
|
|
||||||
|
// Elroy logic
|
||||||
|
data.AppendAsByte(elroyLevel, ref index);
|
||||||
|
|
||||||
|
// Ghost house logic
|
||||||
|
data.Append(sharedPelletCounterActive, ref index);
|
||||||
|
data.AppendAsByte(sharedPelletCounter, ref index);
|
||||||
|
data.Append(pelletTimeout, ref index);
|
||||||
|
|
||||||
|
data.Append(frozen, ref index);
|
||||||
|
data.Append(kinematic, ref index);
|
||||||
|
|
||||||
|
data.AppendAsByte(gameController.Level, ref index);
|
||||||
|
|
||||||
|
var ghostScaredQueueArray = new byte[ghosts.Length];
|
||||||
|
for (int i = 0; i < ghostScaredQueueArray.Length; i++)
|
||||||
{
|
{
|
||||||
|
var add = ghostScaredQueue.TryGetValue(i, out var ghost);
|
||||||
|
if (!add)
|
||||||
|
{
|
||||||
|
ghostScaredQueueArray[i] = byte.MaxValue; // Add a terminator
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ghostScaredQueueArray[i] = (byte)((Ghost)ghost.Reference).Index;
|
||||||
|
}
|
||||||
|
Debug.Log($"{gameObject} Sent a ghostScareQueue of length {ghostScaredQueue.Count}");
|
||||||
|
data.Append(ghostScaredQueueArray, ref index);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
|
{
|
||||||
|
if (eventType != NetworkEventType.GhostUpdate)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Power Pellet logic
|
||||||
|
powerPelletActive = data.ReadBool(ref index);
|
||||||
|
powerPelletCountdown = data.ReadFloat(ref index);
|
||||||
|
powerPelletMultiplier = data.ReadByte(ref index);
|
||||||
|
|
||||||
|
// Blink logic
|
||||||
|
blinkingActivated = data.ReadBool(ref index);
|
||||||
|
blinkCountdown = data.ReadFloat(ref index);
|
||||||
|
blinkCurrentlyWhite = data.ReadBool(ref index);
|
||||||
|
|
||||||
|
// Scattering logic
|
||||||
|
scatterCounter = data.ReadFloat(ref index);
|
||||||
|
scatterPatternIndex = data.ReadByte(ref index);
|
||||||
|
|
||||||
|
// Elroy logic
|
||||||
|
elroyLevel = data.ReadByte(ref index);
|
||||||
|
|
||||||
|
// Ghost house logic
|
||||||
|
sharedPelletCounterActive = data.ReadBool(ref index);
|
||||||
|
sharedPelletCounter = data.ReadByte(ref index);
|
||||||
|
pelletTimeout = data.ReadFloat(ref index);
|
||||||
|
|
||||||
|
frozen = data.ReadBool(ref index);
|
||||||
|
kinematic = data.ReadBool(ref index);
|
||||||
|
|
||||||
|
var level = data.ReadByte(ref index);
|
||||||
|
SetLevelConstants(level);
|
||||||
|
|
||||||
|
ghostScaredQueue.Clear();
|
||||||
|
for (int i = 0; i < ghosts.Length; i++)
|
||||||
|
{
|
||||||
|
var ghostIndex = data[index + i];
|
||||||
|
if (ghostIndex > ghosts.Length) // Reached terminator
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ghostScaredQueue.Add(ghosts[ghostIndex]);
|
||||||
|
}
|
||||||
|
index += ghosts.Length;
|
||||||
|
Debug.Log($"{gameObject} Read back a ghostScareQueue of length {ghostScaredQueue.Count}");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,32 +30,16 @@ namespace Marro.PacManUdon
|
|||||||
|
|
||||||
protected abstract void UpdateAnimator();
|
protected abstract void UpdateAnimator();
|
||||||
|
|
||||||
public override void AppendSyncedData(byte[][] data, ref int offset, NetworkEventType eventType)
|
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
if (eventType != NetworkEventType.PacManTurn)
|
data.Append(GetPosition(), ref index);
|
||||||
{
|
data.Append(GetDirection(), ref index);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var position = GetPosition();
|
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
data[offset++] = BitConverter.GetBytes(position.x);
|
|
||||||
data[offset++] = BitConverter.GetBytes(position.y);
|
|
||||||
|
|
||||||
var direction = GetDirection();
|
|
||||||
data[offset++] = BitConverter.GetBytes(direction.x);
|
|
||||||
data[offset++] = BitConverter.GetBytes(direction.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool SetSyncedData(byte[] data, ref int offset, NetworkEventType eventType)
|
|
||||||
{
|
{
|
||||||
if (eventType != NetworkEventType.PacManTurn)
|
SetPosition(data.ReadVector2(ref index));
|
||||||
{
|
SetDirection(data.ReadVector2(ref index));
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
SetPosition(new Vector2(BitConverter.ToSingle(data, offset), BitConverter.ToSingle(data, offset + 4)));
|
|
||||||
SetDirection(new Vector2(BitConverter.ToSingle(data, offset + 8), BitConverter.ToSingle(data, offset + 12)));
|
|
||||||
offset += 16;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using VRC.SDKBase;
|
using VRC.SDKBase;
|
||||||
using VRC.Udon;
|
using VRC.Udon;
|
||||||
|
using static Cinemachine.DocumentationSortingAttribute;
|
||||||
|
|
||||||
namespace Marro.PacManUdon
|
namespace Marro.PacManUdon
|
||||||
{
|
{
|
||||||
@@ -34,6 +35,7 @@ namespace Marro.PacManUdon
|
|||||||
_ghost = ghost;
|
_ghost = ghost;
|
||||||
_gameManager = gameManager;
|
_gameManager = gameManager;
|
||||||
_animator = GetComponent<Animator>();
|
_animator = GetComponent<Animator>();
|
||||||
|
SetActive(false); // Should only activate for intermission 2
|
||||||
Reset();
|
Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,11 +43,11 @@ namespace Marro.PacManUdon
|
|||||||
{
|
{
|
||||||
_lastUpdate = PoleStrechLevels.None;
|
_lastUpdate = PoleStrechLevels.None;
|
||||||
SetStrechLevel(PoleStrechLevels.None);
|
SetStrechLevel(PoleStrechLevels.None);
|
||||||
SetActive(false); // Should only activate for intermission 2
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetActive(bool isActive)
|
public void SetActive(bool isActive)
|
||||||
{
|
{
|
||||||
|
Debug.Log($"({nameof(PacManUdon)} {nameof(Intermission2Pole)}) SetActive {isActive}.");
|
||||||
gameObject.SetActive(isActive);
|
gameObject.SetActive(isActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,6 +115,7 @@ namespace Marro.PacManUdon
|
|||||||
|
|
||||||
public void SetStrechLevel(PoleStrechLevels level)
|
public void SetStrechLevel(PoleStrechLevels level)
|
||||||
{
|
{
|
||||||
|
Debug.Log($"({nameof(PacManUdon)} {nameof(Intermission2Pole)}) Set strech level to {level}.");
|
||||||
_animator.SetFloat("Strech", GetAnimatorValueForStrechLevel(level));
|
_animator.SetFloat("Strech", GetAnimatorValueForStrechLevel(level));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,12 +144,12 @@ namespace Marro.PacManUdon
|
|||||||
return (Vector2)transform.localPosition;
|
return (Vector2)transform.localPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AppendSyncedData(byte[][] data, ref int index, NetworkEventType eventType)
|
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool SetSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 28
|
Data: 30
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data:
|
Data:
|
||||||
@@ -283,16 +283,70 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: syncedObjects
|
Data: updateRate
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: updateRate
|
||||||
|
- 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: true
|
||||||
|
- Name: _fieldAttributes
|
||||||
|
Entry: 7
|
||||||
|
Data: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 12
|
||||||
|
Data: 1
|
||||||
|
- Name:
|
||||||
|
Entry: 7
|
||||||
|
Data: 19|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: syncedObjects
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: syncedObjects
|
Data: syncedObjects
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 18|System.RuntimeType, mscorlib
|
Data: 21|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: Marro.PacManUdon.SyncedObject[], Assembly-CSharp
|
Data: Marro.PacManUdon.SyncedObject[], Assembly-CSharp
|
||||||
@@ -301,7 +355,7 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 19|System.RuntimeType, mscorlib
|
Data: 22|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: UnityEngine.Component[], UnityEngine.CoreModule
|
Data: UnityEngine.Component[], UnityEngine.CoreModule
|
||||||
@@ -322,7 +376,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 23|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -346,7 +400,7 @@ MonoBehaviour:
|
|||||||
Data: offsetTime
|
Data: offsetTime
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: offsetTime
|
Data: offsetTime
|
||||||
@@ -370,7 +424,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 22|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 25|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -394,7 +448,7 @@ MonoBehaviour:
|
|||||||
Data: internalTime
|
Data: internalTime
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 26|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: internalTime
|
Data: internalTime
|
||||||
@@ -418,7 +472,55 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 24|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 27|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 12
|
||||||
|
Data: 0
|
||||||
|
- 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: nextUpdateTime
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 28|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: nextUpdateTime
|
||||||
|
- 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: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -442,7 +544,7 @@ MonoBehaviour:
|
|||||||
Data: nextEventTime
|
Data: nextEventTime
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 25|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: nextEventTime
|
Data: nextEventTime
|
||||||
@@ -464,108 +566,6 @@ MonoBehaviour:
|
|||||||
- Name: <IsSerialized>k__BackingField
|
- Name: <IsSerialized>k__BackingField
|
||||||
Entry: 5
|
Entry: 5
|
||||||
Data: false
|
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: retriesWithoutSuccess
|
|
||||||
- Name: $v
|
|
||||||
Entry: 7
|
|
||||||
Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
|
||||||
- Name: <Name>k__BackingField
|
|
||||||
Entry: 1
|
|
||||||
Data: retriesWithoutSuccess
|
|
||||||
- Name: <UserType>k__BackingField
|
|
||||||
Entry: 9
|
|
||||||
Data: 11
|
|
||||||
- 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: 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: hasFullSyncReady
|
|
||||||
- Name: $v
|
|
||||||
Entry: 7
|
|
||||||
Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
|
||||||
- Name: <Name>k__BackingField
|
|
||||||
Entry: 1
|
|
||||||
Data: hasFullSyncReady
|
|
||||||
- Name: <UserType>k__BackingField
|
|
||||||
Entry: 7
|
|
||||||
Data: 30|System.RuntimeType, mscorlib
|
|
||||||
- Name:
|
|
||||||
Entry: 1
|
|
||||||
Data: System.Boolean, mscorlib
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name: <SystemType>k__BackingField
|
|
||||||
Entry: 9
|
|
||||||
Data: 30
|
|
||||||
- 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
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
@@ -589,19 +589,19 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: serializationRequested
|
Data: retriesWithoutSuccess
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 32|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: serializationRequested
|
Data: retriesWithoutSuccess
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 30
|
Data: 11
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 30
|
Data: 11
|
||||||
- Name: <SyncMode>k__BackingField
|
- Name: <SyncMode>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
@@ -637,16 +637,118 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: eventsToSend
|
Data: hasFullSyncReady
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: eventsToSend
|
Data: hasFullSyncReady
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 35|System.RuntimeType, mscorlib
|
Data: 35|System.RuntimeType, mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 1
|
||||||
|
Data: System.Boolean, mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name: <SystemType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 35
|
||||||
|
- 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: serializationRequested
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 37|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: serializationRequested
|
||||||
|
- Name: <UserType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 35
|
||||||
|
- Name: <SystemType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 35
|
||||||
|
- 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: 38|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: eventsToSend
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: eventsToSend
|
||||||
|
- Name: <UserType>k__BackingField
|
||||||
|
Entry: 7
|
||||||
|
Data: 40|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: Marro.PacManUdon.NetworkEventType[], Assembly-CSharp
|
Data: Marro.PacManUdon.NetworkEventType[], Assembly-CSharp
|
||||||
@@ -655,7 +757,7 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 36|System.RuntimeType, mscorlib
|
Data: 41|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: System.Int32[], mscorlib
|
Data: System.Int32[], mscorlib
|
||||||
@@ -676,7 +778,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 42|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -700,7 +802,7 @@ MonoBehaviour:
|
|||||||
Data: eventsToSendIndex
|
Data: eventsToSendIndex
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: eventsToSendIndex
|
Data: eventsToSendIndex
|
||||||
@@ -724,7 +826,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 39|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 44|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -748,13 +850,13 @@ MonoBehaviour:
|
|||||||
Data: eventsQueue
|
Data: eventsQueue
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: eventsQueue
|
Data: eventsQueue
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 41|System.RuntimeType, mscorlib
|
Data: 46|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: System.Byte[][], mscorlib
|
Data: System.Byte[][], mscorlib
|
||||||
@@ -763,7 +865,7 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 42|System.RuntimeType, mscorlib
|
Data: 47|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: System.Object[], mscorlib
|
Data: System.Object[], mscorlib
|
||||||
@@ -784,7 +886,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 43|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -808,7 +910,7 @@ MonoBehaviour:
|
|||||||
Data: eventsQueueIndex
|
Data: eventsQueueIndex
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 44|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: eventsQueueIndex
|
Data: eventsQueueIndex
|
||||||
@@ -832,7 +934,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 45|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 50|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -856,7 +958,7 @@ MonoBehaviour:
|
|||||||
Data: eventsQueueIndexAtLastTransmission
|
Data: eventsQueueIndexAtLastTransmission
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 51|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: eventsQueueIndexAtLastTransmission
|
Data: eventsQueueIndexAtLastTransmission
|
||||||
@@ -880,7 +982,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 47|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 52|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -904,16 +1006,16 @@ MonoBehaviour:
|
|||||||
Data: eventTransmissionHistory
|
Data: eventTransmissionHistory
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 48|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 53|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: eventTransmissionHistory
|
Data: eventTransmissionHistory
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 36
|
Data: 41
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 36
|
Data: 41
|
||||||
- Name: <SyncMode>k__BackingField
|
- Name: <SyncMode>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
@@ -928,7 +1030,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 49|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 54|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -952,7 +1054,7 @@ MonoBehaviour:
|
|||||||
Data: eventTransmissionHistoryIndex
|
Data: eventTransmissionHistoryIndex
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: eventTransmissionHistoryIndex
|
Data: eventTransmissionHistoryIndex
|
||||||
@@ -974,108 +1076,6 @@ MonoBehaviour:
|
|||||||
- Name: <IsSerialized>k__BackingField
|
- Name: <IsSerialized>k__BackingField
|
||||||
Entry: 5
|
Entry: 5
|
||||||
Data: false
|
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: 7
|
|
||||||
Data:
|
|
||||||
- Name: $k
|
|
||||||
Entry: 1
|
|
||||||
Data: lastEventTransmissionTime
|
|
||||||
- Name: $v
|
|
||||||
Entry: 7
|
|
||||||
Data: 52|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
|
||||||
- Name: <Name>k__BackingField
|
|
||||||
Entry: 1
|
|
||||||
Data: lastEventTransmissionTime
|
|
||||||
- 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: 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: lastEventId
|
|
||||||
- Name: $v
|
|
||||||
Entry: 7
|
|
||||||
Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
|
||||||
- Name: <Name>k__BackingField
|
|
||||||
Entry: 1
|
|
||||||
Data: lastEventId
|
|
||||||
- Name: <UserType>k__BackingField
|
|
||||||
Entry: 7
|
|
||||||
Data: 55|System.RuntimeType, mscorlib
|
|
||||||
- Name:
|
|
||||||
Entry: 1
|
|
||||||
Data: System.Byte, mscorlib
|
|
||||||
- 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
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
@@ -1099,16 +1099,118 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: networkedData
|
Data: lastEventTransmissionTime
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: lastEventTransmissionTime
|
||||||
|
- 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: 58|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: lastEventId
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: lastEventId
|
||||||
|
- Name: <UserType>k__BackingField
|
||||||
|
Entry: 7
|
||||||
|
Data: 60|System.RuntimeType, mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 1
|
||||||
|
Data: System.Byte, mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name: <SystemType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 60
|
||||||
|
- 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: 61|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: networkedData
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 62|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: networkedData
|
Data: networkedData
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 58|System.RuntimeType, mscorlib
|
Data: 63|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: System.Byte[], mscorlib
|
Data: System.Byte[], mscorlib
|
||||||
@@ -1117,7 +1219,7 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 58
|
Data: 63
|
||||||
- Name: <SyncMode>k__BackingField
|
- Name: <SyncMode>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
@@ -1132,13 +1234,13 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 59|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 64|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 1
|
Data: 1
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 60|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
Data: 65|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
@@ -1162,16 +1264,16 @@ MonoBehaviour:
|
|||||||
Data: <Ready>k__BackingField
|
Data: <Ready>k__BackingField
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 66|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: <Ready>k__BackingField
|
Data: <Ready>k__BackingField
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 30
|
Data: 35
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 30
|
Data: 35
|
||||||
- Name: <SyncMode>k__BackingField
|
- Name: <SyncMode>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
@@ -1186,7 +1288,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 62|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 67|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -1210,16 +1312,16 @@ MonoBehaviour:
|
|||||||
Data: <Synced>k__BackingField
|
Data: <Synced>k__BackingField
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 63|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 68|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: <Synced>k__BackingField
|
Data: <Synced>k__BackingField
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 30
|
Data: 35
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 30
|
Data: 35
|
||||||
- Name: <SyncMode>k__BackingField
|
- Name: <SyncMode>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
@@ -1234,7 +1336,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 64|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 69|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -1258,7 +1360,7 @@ MonoBehaviour:
|
|||||||
Data: <SyncedTime>k__BackingField
|
Data: <SyncedTime>k__BackingField
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: <SyncedTime>k__BackingField
|
Data: <SyncedTime>k__BackingField
|
||||||
@@ -1282,7 +1384,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 66|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 71|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -1306,7 +1408,7 @@ MonoBehaviour:
|
|||||||
Data: <SyncedDeltaTime>k__BackingField
|
Data: <SyncedDeltaTime>k__BackingField
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 72|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: <SyncedDeltaTime>k__BackingField
|
Data: <SyncedDeltaTime>k__BackingField
|
||||||
@@ -1330,7 +1432,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 68|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 73|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -1354,16 +1456,16 @@ MonoBehaviour:
|
|||||||
Data: <IsEventUpdate>k__BackingField
|
Data: <IsEventUpdate>k__BackingField
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 69|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 74|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: <IsEventUpdate>k__BackingField
|
Data: <IsEventUpdate>k__BackingField
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 30
|
Data: 35
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 30
|
Data: 35
|
||||||
- Name: <SyncMode>k__BackingField
|
- Name: <SyncMode>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
@@ -1378,7 +1480,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 70|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 75|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -1402,16 +1504,16 @@ MonoBehaviour:
|
|||||||
Data: <IsOwner>k__BackingField
|
Data: <IsOwner>k__BackingField
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 71|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: <IsOwner>k__BackingField
|
Data: <IsOwner>k__BackingField
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 30
|
Data: 35
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 30
|
Data: 35
|
||||||
- Name: <SyncMode>k__BackingField
|
- Name: <SyncMode>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
@@ -1426,7 +1528,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 72|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 77|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -1450,13 +1552,13 @@ MonoBehaviour:
|
|||||||
Data: DebugImageToIndicateOwner
|
Data: DebugImageToIndicateOwner
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 78|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: DebugImageToIndicateOwner
|
Data: DebugImageToIndicateOwner
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 74|System.RuntimeType, mscorlib
|
Data: 79|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: UnityEngine.Animator, UnityEngine.AnimationModule
|
Data: UnityEngine.Animator, UnityEngine.AnimationModule
|
||||||
@@ -1465,7 +1567,7 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 9
|
Entry: 9
|
||||||
Data: 74
|
Data: 79
|
||||||
- Name: <SyncMode>k__BackingField
|
- Name: <SyncMode>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
@@ -1480,13 +1582,13 @@ MonoBehaviour:
|
|||||||
Data: true
|
Data: true
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 75|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 80|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 1
|
Data: 1
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 76|UnityEngine.SerializeField, UnityEngine.CoreModule
|
Data: 81|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ namespace Marro.PacManUdon
|
|||||||
FullSync = 1,
|
FullSync = 1,
|
||||||
PacManTurn = 2,
|
PacManTurn = 2,
|
||||||
StartGameButtonPressed = 3,
|
StartGameButtonPressed = 3,
|
||||||
|
SyncPellets = 4,
|
||||||
|
GhostUpdate = 5,
|
||||||
}
|
}
|
||||||
|
|
||||||
public class NetworkManager : UdonSharpBehaviour
|
public class NetworkManager : UdonSharpBehaviour
|
||||||
@@ -57,6 +59,10 @@ namespace Marro.PacManUdon
|
|||||||
/// How long to wait since last message to send next ping.
|
/// How long to wait since last message to send next ping.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SerializeField] private float pingDelay = 0.3f;
|
[SerializeField] private float pingDelay = 0.3f;
|
||||||
|
/// <summary>
|
||||||
|
/// The rate at which updates occur.
|
||||||
|
/// </summary>
|
||||||
|
[SerializeField] private float updateRate = 0.0166666667f;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constants
|
#region Constants
|
||||||
@@ -64,6 +70,10 @@ namespace Marro.PacManUdon
|
|||||||
/// The maximum amount of events in the buffer.
|
/// The maximum amount of events in the buffer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const int BufferMaxTotalEvents = 255;
|
private const int BufferMaxTotalEvents = 255;
|
||||||
|
/// <summary>
|
||||||
|
/// The maximum amount of events in the buffer.
|
||||||
|
/// </summary>
|
||||||
|
private const int MaxEventSize = ushort.MaxValue;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The index in an event where the event size is stored.
|
/// The index in an event where the event size is stored.
|
||||||
@@ -102,6 +112,10 @@ namespace Marro.PacManUdon
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private float internalTime;
|
private float internalTime;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Time at which the latest update occured
|
||||||
|
/// </summary>
|
||||||
|
private float nextUpdateTime;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Time at which next received event occured.
|
/// Time at which next received event occured.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -206,16 +220,6 @@ namespace Marro.PacManUdon
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region General
|
#region General
|
||||||
public void Awake()
|
|
||||||
{
|
|
||||||
// I would set the instance variable here, but it's somehow null by the time Initialize() is called... Udon moment?
|
|
||||||
var syncedObjects = root.GetComponentsInChildren<SyncedObject>(includeInactive: true);
|
|
||||||
foreach (var obj in syncedObjects)
|
|
||||||
{
|
|
||||||
obj.networkManager = this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
if (!BitConverter.IsLittleEndian)
|
if (!BitConverter.IsLittleEndian)
|
||||||
@@ -225,8 +229,12 @@ namespace Marro.PacManUdon
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
syncedObjects = root.GetComponentsInChildren<SyncedObject>(includeInactive: true);
|
if (root == null)
|
||||||
|
{
|
||||||
|
root = transform.parent.gameObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
syncedObjects = root.GetComponentsInChildren<SyncedObject>(includeInactive: true);
|
||||||
foreach (var obj in syncedObjects)
|
foreach (var obj in syncedObjects)
|
||||||
{
|
{
|
||||||
obj.networkManager = this;
|
obj.networkManager = this;
|
||||||
@@ -246,13 +254,19 @@ namespace Marro.PacManUdon
|
|||||||
internalTime = 0;
|
internalTime = 0;
|
||||||
SyncedTime = 0;
|
SyncedTime = 0;
|
||||||
SyncedDeltaTime = Time.fixedDeltaTime;
|
SyncedDeltaTime = Time.fixedDeltaTime;
|
||||||
|
nextUpdateTime = SyncedTime;
|
||||||
|
|
||||||
|
if (!Synced)
|
||||||
|
{
|
||||||
|
RequestEvent(NetworkEventType.FullSync); // See if we can sync up
|
||||||
|
}
|
||||||
|
|
||||||
Ready = true;
|
Ready = true;
|
||||||
|
|
||||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Initialized, time offset: {offsetTime}");
|
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Initialized, time offset: {offsetTime}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FixedUpdate()
|
public void Update()
|
||||||
{
|
{
|
||||||
if (!Ready)
|
if (!Ready)
|
||||||
{
|
{
|
||||||
@@ -266,20 +280,21 @@ namespace Marro.PacManUdon
|
|||||||
{
|
{
|
||||||
if (IsOwner)
|
if (IsOwner)
|
||||||
{
|
{
|
||||||
|
ProcessEventsToSend(); // Prepare events from last cycle
|
||||||
ProgressPingTime(); // See if we need to send a ping
|
ProgressPingTime(); // See if we need to send a ping
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ProgressEventTime(); // See if there's events that need to be replayed
|
ApplyReceivedEvents(); // See if there's events that need to be replayed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Forwards simulated time at the FixedUpdate pace
|
// Forwards simulated time at the updateRate pace
|
||||||
PerformFixedSyncedUpdate();
|
while (nextUpdateTime <= internalTime)
|
||||||
|
|
||||||
if (IsOwner)
|
|
||||||
{
|
{
|
||||||
ProcessEventsToSend();
|
ProgressSyncedTime(nextUpdateTime);
|
||||||
|
PerformFixedSyncedUpdate();
|
||||||
|
nextUpdateTime = SyncedTime + updateRate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,7 +306,6 @@ namespace Marro.PacManUdon
|
|||||||
private void PerformFixedSyncedUpdate()
|
private void PerformFixedSyncedUpdate()
|
||||||
{
|
{
|
||||||
IsEventUpdate = false;
|
IsEventUpdate = false;
|
||||||
ProgressSyncedTime(internalTime);
|
|
||||||
|
|
||||||
for (int i = 0; i < syncedObjects.Length; i++)
|
for (int i = 0; i < syncedObjects.Length; i++)
|
||||||
{
|
{
|
||||||
@@ -396,36 +410,27 @@ namespace Marro.PacManUdon
|
|||||||
|
|
||||||
var eventId = GetNextEventId(lastEventId);
|
var eventId = GetNextEventId(lastEventId);
|
||||||
|
|
||||||
InitializeEvent(eventType, timestamp, eventId, BufferMaxTotalEvents, out byte[][] data, out var index);
|
InitializeEvent(eventType, timestamp, eventId, out byte[] data, out var index);
|
||||||
|
|
||||||
foreach (var obj in syncedObjects)
|
foreach (var obj in syncedObjects)
|
||||||
{
|
{
|
||||||
obj.AppendSyncedData(data, ref index, eventType);
|
obj.CollectSyncedData(data, ref index, eventType);
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = Flatten(data, 0, index);
|
|
||||||
|
|
||||||
// Validate and fill in event size
|
// Validate and fill in event size
|
||||||
var eventSize = result.Length;
|
var eventSizeBytes = BitConverter.GetBytes((ushort)index);
|
||||||
|
Array.Copy(eventSizeBytes, 0, data, HeaderEventSizeIndex, eventSizeBytes.Length);
|
||||||
if (eventSize > ushort.MaxValue || eventSize < 0)
|
|
||||||
{
|
|
||||||
Debug.LogError($"({nameof(PacManUdon)} {nameof(NetworkManager)}) New event is too large or negative! Size is {eventSize}, maximum allowed is {ushort.MaxValue}");
|
|
||||||
HandleError(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var eventSizeBytes = BitConverter.GetBytes((ushort)eventSize);
|
|
||||||
Array.Copy(eventSizeBytes, 0, result, HeaderEventSizeIndex, eventSizeBytes.Length);
|
|
||||||
|
|
||||||
if (IsFullSync(eventType))
|
if (IsFullSync(eventType))
|
||||||
{
|
{
|
||||||
hasFullSyncReady = true;
|
hasFullSyncReady = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QueueEventInBuffer(result);
|
data = GetArrayPart(data, 0, index);
|
||||||
|
|
||||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Prepared event of type {eventType} with {eventSize} bytes, timestamp {timestamp} and id {eventId} for serialization.");
|
QueueEventInBuffer(data);
|
||||||
|
|
||||||
|
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Prepared event of type {eventType} with {data.Length} bytes, timestamp {timestamp} and id {eventId} for serialization.");
|
||||||
|
|
||||||
RequestSerializationForEvents();
|
RequestSerializationForEvents();
|
||||||
|
|
||||||
@@ -434,22 +439,16 @@ namespace Marro.PacManUdon
|
|||||||
retriesWithoutSuccess = 0; // We had success!
|
retriesWithoutSuccess = 0; // We had success!
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void InitializeEvent(NetworkEventType eventType, float timestamp, byte eventId, int maxSize, out byte[][] data, out int index)
|
private static void InitializeEvent(NetworkEventType eventType, float timestamp, byte eventId, out byte[] data, out int index)
|
||||||
{
|
{
|
||||||
// Create header
|
data = new byte[MaxEventSize];
|
||||||
|
|
||||||
|
// Create header (note: event size is added later)
|
||||||
var timestampBytes = BitConverter.GetBytes(timestamp);
|
var timestampBytes = BitConverter.GetBytes(timestamp);
|
||||||
|
Array.Copy(timestampBytes, 0, data, HeaderTimestampIndex, timestampBytes.Length);
|
||||||
var header = new byte[HeaderLength];
|
data[HeaderEventIdIndex] = eventId;
|
||||||
|
data[HeaderEventTypeIndex] = ((int)eventType).ToByte();
|
||||||
// Event size is added later
|
index = HeaderLength;
|
||||||
Array.Copy(timestampBytes, 0, header, HeaderTimestampIndex, timestampBytes.Length);
|
|
||||||
header[HeaderEventIdIndex] = eventId;
|
|
||||||
header[HeaderEventTypeIndex] = Int32ToByte((int)eventType);
|
|
||||||
|
|
||||||
// Initialize event container
|
|
||||||
data = new byte[maxSize][];
|
|
||||||
data[0] = header;
|
|
||||||
index = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RequestSerializationForEvents()
|
private void RequestSerializationForEvents()
|
||||||
@@ -635,7 +634,6 @@ namespace Marro.PacManUdon
|
|||||||
|
|
||||||
if (Synced)
|
if (Synced)
|
||||||
{
|
{
|
||||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)} blaat");
|
|
||||||
UpdateNextEventTime();
|
UpdateNextEventTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -654,13 +652,13 @@ namespace Marro.PacManUdon
|
|||||||
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 ProgressEventTime()
|
private void ApplyReceivedEvents()
|
||||||
{
|
{
|
||||||
IsEventUpdate = true;
|
IsEventUpdate = true;
|
||||||
|
|
||||||
while (eventsQueueIndex > 0 && nextEventTime <= internalTime)
|
while (eventsQueueIndex > 0 && nextEventTime <= internalTime)
|
||||||
{
|
{
|
||||||
var success = PerformEvent(eventsQueue[0]);
|
var success = ApplyEvent(eventsQueue[0]);
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
@@ -668,12 +666,11 @@ namespace Marro.PacManUdon
|
|||||||
}
|
}
|
||||||
|
|
||||||
DequeueEventsFromBuffer(1);
|
DequeueEventsFromBuffer(1);
|
||||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)} damn");
|
|
||||||
UpdateNextEventTime();
|
UpdateNextEventTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool PerformEvent(byte[] @event)
|
private bool ApplyEvent(byte[] @event)
|
||||||
{
|
{
|
||||||
var timestamp = GetTimestampFromHeader(@event);
|
var timestamp = GetTimestampFromHeader(@event);
|
||||||
var eventType = GetEventTypeFromHeader(@event);
|
var eventType = GetEventTypeFromHeader(@event);
|
||||||
@@ -696,7 +693,7 @@ namespace Marro.PacManUdon
|
|||||||
|
|
||||||
foreach (var obj in syncedObjects)
|
foreach (var obj in syncedObjects)
|
||||||
{
|
{
|
||||||
var success = obj.SetSyncedData(@event, ref index, eventType);
|
var success = obj.WriteSyncedData(@event, ref index, eventType);
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
@@ -720,7 +717,7 @@ namespace Marro.PacManUdon
|
|||||||
Synced = true;
|
Synced = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Processed incoming event! Total {index} bytes.");
|
Debug.Log($"({nameof(PacManUdon)} {nameof(NetworkManager)}) Performed incoming eventof type {eventType}! Total {index} bytes.");
|
||||||
|
|
||||||
retriesWithoutSuccess = 0; // We had success!
|
retriesWithoutSuccess = 0; // We had success!
|
||||||
|
|
||||||
@@ -937,9 +934,6 @@ namespace Marro.PacManUdon
|
|||||||
Array.Copy(data, start, result, 0, length);
|
Array.Copy(data, start, result, 0, length);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte Int32ToByte(int value) =>
|
|
||||||
(byte)value; // Doing this inline causes an error...?
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Debug
|
#region Debug
|
||||||
@@ -975,6 +969,16 @@ namespace Marro.PacManUdon
|
|||||||
{
|
{
|
||||||
SendEventSoon(NetworkEventType.FullSync);
|
SendEventSoon(NetworkEventType.FullSync);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DoPelletSync()
|
||||||
|
{
|
||||||
|
SendEventSoon(NetworkEventType.SyncPellets);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DoGhostSync()
|
||||||
|
{
|
||||||
|
SendEventSoon(NetworkEventType.GhostUpdate);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -316,16 +316,14 @@ namespace Marro.PacManUdon
|
|||||||
Pellet pellet = other.gameObject.GetComponent<Pellet>();
|
Pellet pellet = other.gameObject.GetComponent<Pellet>();
|
||||||
if (pellet)
|
if (pellet)
|
||||||
{
|
{
|
||||||
pellet.gameObject.SetActive(false);
|
|
||||||
|
|
||||||
if (pellet.isPowerPellet)
|
if (pellet.isPowerPellet)
|
||||||
{
|
{
|
||||||
gameController.GotPowerPellet();
|
gameController.GotPowerPellet(pellet);
|
||||||
freezeSeconds = 0.05f;
|
freezeSeconds = 0.05f;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gameController.GotPellet();
|
gameController.GotPellet(pellet);
|
||||||
freezeSeconds = 0.0166666666666667f;
|
freezeSeconds = 0.0166666666666667f;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -336,30 +334,28 @@ namespace Marro.PacManUdon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AppendSyncedData(byte[][] data, ref int offset, NetworkEventType eventType)
|
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
if (eventType != NetworkEventType.PacManTurn || kinematic || frozen || !enabled)
|
if (eventType != NetworkEventType.PacManTurn || kinematic || frozen || !enabled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
data[offset++] = BitConverter.GetBytes(targetDirection.x);
|
data.Append(targetDirection, ref index);
|
||||||
data[offset++] = BitConverter.GetBytes(targetDirection.y);
|
|
||||||
|
|
||||||
base.AppendSyncedData(data, ref offset, eventType);
|
base.CollectSyncedData(data, ref index, eventType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool SetSyncedData(byte[] data, ref int offset, NetworkEventType eventType)
|
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
if (eventType != NetworkEventType.PacManTurn || kinematic || frozen || !enabled)
|
if (eventType != NetworkEventType.PacManTurn || kinematic || frozen || !enabled)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetTargetDirection(new Vector2(BitConverter.ToSingle(data, offset), BitConverter.ToSingle(data, offset + 4)));
|
SetTargetDirection(data.ReadVector2(ref index));
|
||||||
offset += 8;
|
|
||||||
|
|
||||||
return base.SetSyncedData(data, ref offset, eventType);
|
return base.WriteSyncedData(data, ref index, eventType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 8
|
Data: 9
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data:
|
Data:
|
||||||
@@ -109,31 +109,25 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: pellets
|
Data: <PelletCollectedCount>k__BackingField
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: pellets
|
Data: <PelletCollectedCount>k__BackingField
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 7|System.RuntimeType, mscorlib
|
Data: 7|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: Marro.PacManUdon.Pellet[], Assembly-CSharp
|
Data: System.Int32, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 7
|
Entry: 9
|
||||||
Data: 8|System.RuntimeType, mscorlib
|
Data: 7
|
||||||
- Name:
|
|
||||||
Entry: 1
|
|
||||||
Data: UnityEngine.Component[], UnityEngine.CoreModule
|
|
||||||
- Name:
|
|
||||||
Entry: 8
|
|
||||||
Data:
|
|
||||||
- Name: <SyncMode>k__BackingField
|
- Name: <SyncMode>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
@@ -148,7 +142,7 @@ MonoBehaviour:
|
|||||||
Data: false
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 9|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 0
|
||||||
@@ -169,25 +163,31 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: pelletRenderers
|
Data: pellets
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 9|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: pelletRenderers
|
Data: pellets
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 11|System.RuntimeType, mscorlib
|
Data: 10|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: UnityEngine.Renderer[], UnityEngine.CoreModule
|
Data: Marro.PacManUdon.Pellet[], Assembly-CSharp
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
- Name: <SystemType>k__BackingField
|
- Name: <SystemType>k__BackingField
|
||||||
Entry: 9
|
Entry: 7
|
||||||
Data: 11
|
Data: 11|System.RuntimeType, mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 1
|
||||||
|
Data: UnityEngine.Component[], UnityEngine.CoreModule
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
- Name: <SyncMode>k__BackingField
|
- Name: <SyncMode>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
@@ -476,6 +476,60 @@ MonoBehaviour:
|
|||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 7
|
||||||
|
Data:
|
||||||
|
- Name: $k
|
||||||
|
Entry: 1
|
||||||
|
Data: syncedPelletsCollected
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 26|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: syncedPelletsCollected
|
||||||
|
- Name: <UserType>k__BackingField
|
||||||
|
Entry: 7
|
||||||
|
Data: 27|System.RuntimeType, mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 1
|
||||||
|
Data: System.Byte[], mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name: <SystemType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 27
|
||||||
|
- 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:
|
- Name:
|
||||||
Entry: 13
|
Entry: 13
|
||||||
Data:
|
Data:
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
using UdonSharp;
|
using System;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Marro.PacManUdon
|
namespace Marro.PacManUdon
|
||||||
{
|
{
|
||||||
public class PelletManager : SyncedObject
|
public class PelletManager : SyncedObject
|
||||||
{
|
{
|
||||||
|
public int PelletCount => pellets.Length;
|
||||||
|
public int PelletCollectedCount { get; private set; }
|
||||||
|
|
||||||
Pellet[] pellets;
|
Pellet[] pellets;
|
||||||
Renderer[] pelletRenderers;
|
|
||||||
Animator[] powerPellets;
|
Animator[] powerPellets;
|
||||||
|
|
||||||
bool powerPelletBlinkEnabled;
|
bool powerPelletBlinkEnabled;
|
||||||
@@ -14,20 +16,18 @@ namespace Marro.PacManUdon
|
|||||||
float powerPelletBlinkProgress;
|
float powerPelletBlinkProgress;
|
||||||
bool powerPelletBlinkCurrentlyVisible;
|
bool powerPelletBlinkCurrentlyVisible;
|
||||||
|
|
||||||
|
byte[] syncedPelletsCollected;
|
||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
gameObject.SetActive(true);
|
gameObject.SetActive(true);
|
||||||
pellets = GetComponentsInChildren<Pellet>(includeInactive: true);
|
pellets = GetComponentsInChildren<Pellet>(includeInactive: true);
|
||||||
|
|
||||||
pelletRenderers = new Renderer[pellets.Length];
|
|
||||||
for (int i = 0; i < pelletRenderers.Length; i++)
|
|
||||||
{
|
|
||||||
pelletRenderers[i] = pellets[i].GetComponent<Renderer>();
|
|
||||||
}
|
|
||||||
|
|
||||||
powerPellets = GetComponentsInChildren<Animator>(true);
|
powerPellets = GetComponentsInChildren<Animator>(true);
|
||||||
powerPelletBlinkToggleInterval = PacManConstants.GetPowerPelletBlinkToggleInterval();
|
powerPelletBlinkToggleInterval = PacManConstants.GetPowerPelletBlinkToggleInterval();
|
||||||
SetPowerPelletsBlink(false);
|
SetPowerPelletsBlink(false);
|
||||||
|
|
||||||
|
RestoreAllPellets();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SyncedUpdate()
|
public override void SyncedUpdate()
|
||||||
@@ -71,29 +71,63 @@ namespace Marro.PacManUdon
|
|||||||
powerPelletBlinkEnabled = !frozen;
|
powerPelletBlinkEnabled = !frozen;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RestoreAllPellets()
|
public int PelletCollected(Pellet pellet)
|
||||||
|
{
|
||||||
|
pellet.gameObject.SetActive(false);
|
||||||
|
|
||||||
|
var index = pellet.transform.GetSiblingIndex();
|
||||||
|
syncedPelletsCollected[index/8] |= (byte)(1 << index%8);
|
||||||
|
|
||||||
|
PelletCollectedCount++;
|
||||||
|
|
||||||
|
return PelletCollectedCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int RestoreAllPellets()
|
||||||
{
|
{
|
||||||
foreach (var pellet in pellets)
|
foreach (var pellet in pellets)
|
||||||
{
|
{
|
||||||
pellet.gameObject.SetActive(true);
|
pellet.gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Renderer pelletRenderer in pelletRenderers)
|
syncedPelletsCollected = new byte[pellets.Length/8 + 1];
|
||||||
|
PelletCollectedCount = 0;
|
||||||
|
|
||||||
|
return PelletCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetPelletsCollectedFromSync()
|
||||||
{
|
{
|
||||||
pelletRenderer.enabled = true;
|
for (int i = 0; i < pellets.Length; i++)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void AppendSyncedData(byte[][] data, ref int index, NetworkEventType eventType)
|
|
||||||
{
|
{
|
||||||
|
var active = (syncedPelletsCollected[i/8] & (byte)(1 << i%8)) == 0;
|
||||||
|
pellets[i].gameObject.SetActive(active);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool SetSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
|
{
|
||||||
|
if (eventType != NetworkEventType.SyncPellets)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
data.Append((byte)PelletCollectedCount, ref index);
|
||||||
|
data.Append(syncedPelletsCollected, ref index);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
|
{
|
||||||
|
if (eventType != NetworkEventType.SyncPellets)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int PelletCount => pellets.Length;
|
PelletCollectedCount = data.ReadByte(ref index);
|
||||||
|
Array.Copy(data, index, syncedPelletsCollected, 0, syncedPelletsCollected.Length);
|
||||||
|
index += syncedPelletsCollected.Length;
|
||||||
|
SetPelletsCollectedFromSync();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,12 +47,12 @@ namespace Marro.PacManUdon
|
|||||||
gameObject.SetActive(false);
|
gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AppendSyncedData(byte[][] data, ref int index, NetworkEventType eventType)
|
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool SetSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ namespace Marro.PacManUdon
|
|||||||
pacMan.SetPosition(attractScreenElements[16].transform.localPosition);
|
pacMan.SetPosition(attractScreenElements[16].transform.localPosition);
|
||||||
pacMan.SetDirection(Vector2.left);
|
pacMan.SetDirection(Vector2.left);
|
||||||
|
|
||||||
ghostManager.Reset();
|
ghostManager.RestartLevel();
|
||||||
ghostManager.SetLevel(2);
|
ghostManager.SetLevel(2);
|
||||||
ghostManager.SetKinematic(true);
|
ghostManager.SetKinematic(true);
|
||||||
ghostManager.SetActive(true);
|
ghostManager.SetActive(true);
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ namespace Marro.PacManUdon
|
|||||||
case 1:
|
case 1:
|
||||||
// Show pole
|
// Show pole
|
||||||
SetIntermissionScreenVisible(true);
|
SetIntermissionScreenVisible(true);
|
||||||
intermission2Pole.Reset();
|
|
||||||
intermission2Pole.SetActive(true);
|
intermission2Pole.SetActive(true);
|
||||||
|
intermission2Pole.Reset();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
// Start music
|
// Start music
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Marro.PacManUdon
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
// Make maze visible
|
// Make maze visible
|
||||||
RestartLevel();
|
RestartLevel(afterLifeLost: true);
|
||||||
SetMazeVisible(true);
|
SetMazeVisible(true);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
@@ -42,7 +42,7 @@ namespace Marro.PacManUdon
|
|||||||
SetFrozen(false);
|
SetFrozen(false);
|
||||||
soundManager.SuppressSound(false);
|
soundManager.SuppressSound(false);
|
||||||
soundManager.StartGhostSound();
|
soundManager.StartGhostSound();
|
||||||
soundManager.UpdatePelletCount(pelletCountRemaining);
|
soundManager.UpdatePelletCount(pelletManager.PelletCount - pelletManager.PelletCollectedCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ namespace Marro.PacManUdon
|
|||||||
// Increment level, show ready, show pellets, show lives indicators
|
// Increment level, show ready, show pellets, show lives indicators
|
||||||
IncrementLevel();
|
IncrementLevel();
|
||||||
statusDisplay.SetExtraLivesDisplayVisible(true);
|
statusDisplay.SetExtraLivesDisplayVisible(true);
|
||||||
|
statusDisplay.SetLevelDisplayVisible(true);
|
||||||
statusDisplay.SetReadyTextVisible(true);
|
statusDisplay.SetReadyTextVisible(true);
|
||||||
SetPelletsActive(true);
|
SetPelletsActive(true);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -254,12 +254,12 @@ public class SoundManager : SyncedObject
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AppendSyncedData(byte[][] data, ref int index, NetworkEventType eventType)
|
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool SetSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,12 +167,12 @@ namespace Marro.PacManUdon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AppendSyncedData(byte[][] data, ref int index, NetworkEventType eventType)
|
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool SetSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Marro.PacManUdon
|
|||||||
public NetworkManager networkManager;
|
public NetworkManager networkManager;
|
||||||
|
|
||||||
public virtual void SyncedUpdate() { }
|
public virtual void SyncedUpdate() { }
|
||||||
public abstract void AppendSyncedData(byte[][] data, ref int index, NetworkEventType eventType);
|
public abstract void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType);
|
||||||
public abstract bool SetSyncedData(byte[] data, ref int index, NetworkEventType eventType);
|
public abstract bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
14
Assets/Scripts/Test.cs
Normal file
14
Assets/Scripts/Test.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
namespace Marro.PacManUdon
|
||||||
|
{
|
||||||
|
using UdonSharp;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class Test : UdonSharpBehaviour
|
||||||
|
{
|
||||||
|
[SerializeField] Pellet pellet;
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
Debug.Log(pellet.enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/Test.cs.meta
Normal file
11
Assets/Scripts/Test.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0227a738d77ab0849bdc9047b5b27c78
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
118
Assets/Scripts/Test1.asset
Normal file
118
Assets/Scripts/Test1.asset
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
%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:
|
||||||
8
Assets/Scripts/Test1.asset.meta
Normal file
8
Assets/Scripts/Test1.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 184e93443ec1bb24fa4e1db8b51405da
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -128,26 +128,25 @@ public class TestBall : SyncedObject
|
|||||||
Debug.Log($"({nameof(TestBall)}) Up button pressed, jumped up at {GetProgress()} to {amountUp}.");
|
Debug.Log($"({nameof(TestBall)}) Up button pressed, jumped up at {GetProgress()} to {amountUp}.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AppendSyncedData(byte[][] data, ref int index, NetworkEventType eventType)
|
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
if (eventType == NetworkEventType.FullSync
|
if (eventType == NetworkEventType.FullSync
|
||||||
|| eventType == NetworkEventType.FullSyncForced)
|
|| eventType == NetworkEventType.FullSyncForced)
|
||||||
{
|
{
|
||||||
Debug.Log($"({nameof(TestBall)}) Sending sync data at progress {GetProgress()} and amountUp {amountUp}.");
|
Debug.Log($"({nameof(TestBall)}) Sending sync data at progress {GetProgress()} and amountUp {amountUp}.");
|
||||||
data[index++] = BitConverter.GetBytes(amountUp);
|
data.Append(amountUp, ref index);
|
||||||
data[index++] = BitConverter.GetBytes(GetProgress());
|
data.Append(GetProgress(), ref index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool SetSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||||
{
|
{
|
||||||
if (eventType == NetworkEventType.FullSync
|
if (eventType == NetworkEventType.FullSync
|
||||||
|| eventType == NetworkEventType.FullSyncForced)
|
|| eventType == NetworkEventType.FullSyncForced)
|
||||||
{
|
{
|
||||||
amountUp = BitConverter.ToSingle(data, index);
|
amountUp = data.ReadFloat(ref index);
|
||||||
SetProgress(BitConverter.ToSingle(data, index + 4));
|
SetProgress(data.ReadFloat(ref index));
|
||||||
//Debug.Log($"({nameof(TestBall)}) Received sync event, synced to progress {GetProgress()} and amountUp {amountUp}.");
|
//Debug.Log($"({nameof(TestBall)}) Received sync event, synced to progress {GetProgress()} and amountUp {amountUp}.");
|
||||||
index += 8;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -207,4 +207,6 @@ QualitySettings:
|
|||||||
excludedTargetPlatforms:
|
excludedTargetPlatforms:
|
||||||
- Standalone
|
- Standalone
|
||||||
m_TextureMipmapLimitGroupNames: []
|
m_TextureMipmapLimitGroupNames: []
|
||||||
m_PerPlatformDefaultQuality: {}
|
m_PerPlatformDefaultQuality:
|
||||||
|
Server: 0
|
||||||
|
Standalone: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user