Ghosts synced with some issues
This commit is contained in:
@@ -9746,6 +9746,7 @@ RectTransform:
|
||||
- {fileID: 223918359}
|
||||
- {fileID: 1673553851}
|
||||
- {fileID: 1837547959}
|
||||
- {fileID: 1437073246}
|
||||
m_Father: {fileID: 653732755}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
@@ -32392,6 +32393,140 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
|
||||
m_PrefabInstance: {fileID: 1547903860}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &1035743220
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1035743221}
|
||||
- component: {fileID: 1035743223}
|
||||
- component: {fileID: 1035743222}
|
||||
m_Layer: 0
|
||||
m_Name: Text (TMP)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1035743221
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1035743220}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1437073246}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1035743222
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1035743220}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: Pellet Sync
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4281479730
|
||||
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 24
|
||||
m_fontSizeBase: 24
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_enableWordWrapping: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 1
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!222 &1035743223
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1035743220}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1036453362
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -46008,6 +46143,139 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 1315692994360949719, guid: 00a825a5aeafee94789192f61cbb3a5a, type: 3}
|
||||
m_PrefabInstance: {fileID: 1628865249}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &1437073245
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1437073246}
|
||||
- component: {fileID: 1437073249}
|
||||
- component: {fileID: 1437073248}
|
||||
- component: {fileID: 1437073247}
|
||||
m_Layer: 0
|
||||
m_Name: Ghost Sync
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1437073246
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1437073245}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0.0000006170327}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1035743221}
|
||||
m_Father: {fileID: 291096817}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 138.00223, y: 50.000023}
|
||||
m_SizeDelta: {x: 160, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1437073247
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1437073245}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 1437073248}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 811840792}
|
||||
m_TargetAssemblyTypeName:
|
||||
m_MethodName: SendCustomEvent
|
||||
m_Mode: 5
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument: DoGhostSync
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!114 &1437073248
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1437073245}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 2100000, guid: 35630e38b4e5ffb40b44ec5348b4333f, type: 2}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &1437073249
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1437073245}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1438618202
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -55122,10 +55390,10 @@ MonoBehaviour:
|
||||
DynamicMaterials:
|
||||
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 2541243872366204002, guid: 7168d13094fcae94b81e672d1f4ab73f, type: 2}
|
||||
- {fileID: 2100000, guid: fc67956adbc95584ba3ae3b18d1e430d, type: 2}
|
||||
- {fileID: 10758, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 2100000, guid: a3869014ba4893d409f150224856180a, type: 2}
|
||||
- {fileID: 2100000, guid: fc67956adbc95584ba3ae3b18d1e430d, type: 2}
|
||||
- {fileID: 2100000, guid: ae0c7562e66fca1469f7ee603e462581, type: 2}
|
||||
- {fileID: 2100000, guid: db2b6d76bdd134244912a5c1c9971804, type: 2}
|
||||
LightMapsNear: []
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Marro.PacManUdon
|
||||
target[index++] = (byte)value;
|
||||
|
||||
public static void Append(this byte[] target, bool value, ref int index) =>
|
||||
target[index++] = value ? (byte)1 : (byte)1;
|
||||
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);
|
||||
@@ -33,6 +33,13 @@ namespace Marro.PacManUdon
|
||||
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);
|
||||
|
||||
@@ -143,5 +150,12 @@ namespace Marro.PacManUdon
|
||||
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;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,7 +22,6 @@ namespace Marro.PacManUdon
|
||||
|
||||
[SerializeField] private GameObject recorder;
|
||||
|
||||
|
||||
[Header("Game settings")]
|
||||
[SerializeField] private int startingExtraLives = 3;
|
||||
[SerializeField] private int scoreToExtraLife = 10000;
|
||||
@@ -35,10 +34,10 @@ namespace Marro.PacManUdon
|
||||
private GameObject[] intermissionScreenElements;
|
||||
|
||||
private PacManGameState gameState;
|
||||
[UdonSynced, FieldChangeCallback(nameof(Score))] private int score;
|
||||
[UdonSynced, FieldChangeCallback(nameof(Level))] private int level;
|
||||
[UdonSynced, FieldChangeCallback(nameof(HighScore))] private int highScore;
|
||||
[UdonSynced, FieldChangeCallback(nameof(ExtraLives))] private int extraLives;
|
||||
private int score;
|
||||
private int level;
|
||||
private int highScore;
|
||||
private int extraLives;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
@@ -147,7 +146,7 @@ namespace Marro.PacManUdon
|
||||
|
||||
// SetInGameComponentVisibility(true);
|
||||
|
||||
ghostManager.Reset(afterLifeLost);
|
||||
ghostManager.RestartLevel(afterLifeLost);
|
||||
pacMan.Reset();
|
||||
bonusFruit.Despawn();
|
||||
soundManager.Reset();
|
||||
@@ -421,58 +420,8 @@ namespace Marro.PacManUdon
|
||||
return true;
|
||||
}
|
||||
|
||||
public int ExtraLives
|
||||
{
|
||||
set
|
||||
{
|
||||
SetExtraLives(value);
|
||||
}
|
||||
get => extraLives;
|
||||
}
|
||||
public PacManGameState GameState => gameState;
|
||||
|
||||
public PacManGameState GameState
|
||||
{
|
||||
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;
|
||||
}
|
||||
public int Level => level;
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 36
|
||||
Data: 37
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
@@ -1898,6 +1898,54 @@ MonoBehaviour:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: <Index>k__BackingField
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 95|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: <Index>k__BackingField
|
||||
- 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: 96|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
|
||||
@@ -85,7 +85,10 @@ namespace Marro.PacManUdon
|
||||
private Vector2[] predefinedPath;
|
||||
private int predefinedPathIndex;
|
||||
|
||||
public void Initialize(PacMan pacMan, Ghost blinky, Transform startTransform, Vector2 homePosition, Vector2 idlePosition1, Vector2 idlePosition2, Vector2 cornerPosition)
|
||||
public bool IsScared => isScared;
|
||||
public int Index { get; private set; }
|
||||
|
||||
public void Initialize(PacMan pacMan, Ghost blinky, Transform startTransform, Vector2 homePosition, Vector2 idlePosition1, Vector2 idlePosition2, Vector2 cornerPosition, int index)
|
||||
{
|
||||
ghostManager = transform.parent.GetComponent<GhostManager>();
|
||||
animator = GetComponent<Animator>();
|
||||
@@ -104,6 +107,8 @@ namespace Marro.PacManUdon
|
||||
startRotation = startTransform.localRotation;
|
||||
|
||||
frozenState = PacManGhostFrozenState.Frozen;
|
||||
|
||||
Index = index;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
@@ -758,8 +763,6 @@ namespace Marro.PacManUdon
|
||||
return ghostState;
|
||||
}
|
||||
|
||||
public bool IsScared => isScared;
|
||||
|
||||
public void SetSpeed(float speed)
|
||||
{
|
||||
this.speed = speed;
|
||||
@@ -780,15 +783,15 @@ namespace Marro.PacManUdon
|
||||
data.Append(turnAroundSoon, ref index);
|
||||
data.Append(speed, ref index);
|
||||
|
||||
data.Append((byte)ghostState, ref index);
|
||||
data.AppendAsByte((int)ghostState, ref index);
|
||||
data.Append(isScared, ref index);
|
||||
data.Append(scattering, ref index);
|
||||
data.Append((byte)frozenState, ref index);
|
||||
data.AppendAsByte((int)frozenState, ref index);
|
||||
|
||||
data.Append(offGrid, ref index);
|
||||
data.Append((byte)housePelletCounter, ref index);
|
||||
data.AppendAsByte(housePelletCounter, ref index);
|
||||
data.Append(housePelletCounterActive, ref index);
|
||||
data.Append((byte)housePelletCounterLimit, ref index);
|
||||
data.AppendAsByte(housePelletCounterLimit, ref index);
|
||||
data.Append(faceInStartingDirectionUntilUnfrozen, ref index);
|
||||
|
||||
base.CollectSyncedData(data, ref index, eventType);
|
||||
@@ -806,6 +809,7 @@ namespace Marro.PacManUdon
|
||||
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);
|
||||
|
||||
@@ -781,25 +781,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: powerPelletActive
|
||||
Data: powerPelletDuration
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: powerPelletActive
|
||||
Data: powerPelletDuration
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 41|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Boolean, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
Entry: 9
|
||||
Data: 21
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 41
|
||||
Data: 21
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -814,7 +808,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 42|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 41|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -835,19 +829,25 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: powerPelletDuration
|
||||
Data: scatterPattern
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 42|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: powerPelletDuration
|
||||
Data: scatterPattern
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 21
|
||||
Entry: 7
|
||||
Data: 43|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Single[], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 21
|
||||
Data: 43
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -883,13 +883,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: powerPelletCountdown
|
||||
Data: pelletTimeoutLimit
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 45|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: powerPelletCountdown
|
||||
Data: pelletTimeoutLimit
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 21
|
||||
@@ -931,19 +931,25 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: powerPelletMultiplier
|
||||
Data: powerPelletActive
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 47|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: powerPelletMultiplier
|
||||
Data: powerPelletActive
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 36
|
||||
Entry: 7
|
||||
Data: 48|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Boolean, mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 36
|
||||
Data: 48
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -958,7 +964,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 48|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 49|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -979,25 +985,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: ghostScaredQueue
|
||||
Data: powerPelletCountdown
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 50|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: ghostScaredQueue
|
||||
Data: powerPelletCountdown
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 50|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.SDK3.Data.DataList, VRCSDK3
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
Entry: 9
|
||||
Data: 21
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 50
|
||||
Data: 21
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1033,19 +1033,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: blinkingActivated
|
||||
Data: powerPelletMultiplier
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 52|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: blinkingActivated
|
||||
Data: powerPelletMultiplier
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 41
|
||||
Data: 36
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 41
|
||||
Data: 36
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1081,10 +1081,112 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: blinkCountdown
|
||||
Data: ghostScaredQueue
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 54|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: ghostScaredQueue
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 55|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: VRC.SDK3.Data.DataList, VRCSDK3
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 55
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 56|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
- Name:
|
||||
Entry: 13
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 7
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: blinkingActivated
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 57|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: blinkingActivated
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 48
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 48
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 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: blinkCountdown
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 59|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: blinkCountdown
|
||||
@@ -1108,7 +1210,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 55|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 60|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1132,118 +1234,16 @@ MonoBehaviour:
|
||||
Data: blinkCurrentlyWhite
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 56|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: blinkCurrentlyWhite
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 41
|
||||
Data: 48
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 41
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
- Name:
|
||||
Entry: 6
|
||||
Data:
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 57|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- 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: scatterCounter
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: scatterCounter
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 21
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 21
|
||||
- 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: 59|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: scatterPattern
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 60|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: scatterPattern
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 61|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Single[], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 61
|
||||
Data: 48
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1279,19 +1279,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: scatterPatternIndex
|
||||
Data: scatterCounter
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 63|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: scatterPatternIndex
|
||||
Data: scatterCounter
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 36
|
||||
Data: 21
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 36
|
||||
Data: 21
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1327,13 +1327,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: elroyLevel
|
||||
Data: scatterPatternIndex
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 65|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: elroyLevel
|
||||
Data: scatterPatternIndex
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 36
|
||||
@@ -1351,7 +1351,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: true
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 66|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
@@ -1375,19 +1375,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: sharedPelletCounterActive
|
||||
Data: elroyLevel
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: sharedPelletCounterActive
|
||||
Data: elroyLevel
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 41
|
||||
Data: 36
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 41
|
||||
Data: 36
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1399,7 +1399,7 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: <IsSerialized>k__BackingField
|
||||
Entry: 5
|
||||
Data: false
|
||||
Data: true
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 68|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
@@ -1423,19 +1423,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: sharedPelletCounter
|
||||
Data: sharedPelletCounterActive
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 69|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: sharedPelletCounter
|
||||
Data: sharedPelletCounterActive
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 36
|
||||
Data: 48
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 36
|
||||
Data: 48
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1471,25 +1471,19 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: sharedPelletCounterReleaseValues
|
||||
Data: sharedPelletCounter
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 71|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: sharedPelletCounterReleaseValues
|
||||
Data: sharedPelletCounter
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 7
|
||||
Data: 72|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Int32[], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
Entry: 9
|
||||
Data: 36
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 72
|
||||
Data: 36
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1504,7 +1498,7 @@ MonoBehaviour:
|
||||
Data: false
|
||||
- Name: _fieldAttributes
|
||||
Entry: 7
|
||||
Data: 73|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
Data: 72|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||
- Name:
|
||||
Entry: 12
|
||||
Data: 0
|
||||
@@ -1525,19 +1519,25 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: pelletTimeout
|
||||
Data: sharedPelletCounterReleaseValues
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 74|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: pelletTimeout
|
||||
Data: sharedPelletCounterReleaseValues
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 21
|
||||
Entry: 7
|
||||
Data: 74|System.RuntimeType, mscorlib
|
||||
- Name:
|
||||
Entry: 1
|
||||
Data: System.Int32[], mscorlib
|
||||
- Name:
|
||||
Entry: 8
|
||||
Data:
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 21
|
||||
Data: 74
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1573,13 +1573,13 @@ MonoBehaviour:
|
||||
Data:
|
||||
- Name: $k
|
||||
Entry: 1
|
||||
Data: pelletTimeoutLimit
|
||||
Data: pelletTimeout
|
||||
- Name: $v
|
||||
Entry: 7
|
||||
Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||
- Name: <Name>k__BackingField
|
||||
Entry: 1
|
||||
Data: pelletTimeoutLimit
|
||||
Data: pelletTimeout
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 21
|
||||
@@ -1630,10 +1630,10 @@ MonoBehaviour:
|
||||
Data: frozen
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 41
|
||||
Data: 48
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 41
|
||||
Data: 48
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
@@ -1678,10 +1678,10 @@ MonoBehaviour:
|
||||
Data: kinematic
|
||||
- Name: <UserType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 41
|
||||
Data: 48
|
||||
- Name: <SystemType>k__BackingField
|
||||
Entry: 9
|
||||
Data: 41
|
||||
Data: 48
|
||||
- Name: <SyncMode>k__BackingField
|
||||
Entry: 7
|
||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||
|
||||
@@ -24,9 +24,12 @@ namespace Marro.PacManUdon
|
||||
private int elroy1PelletCount;
|
||||
private int elroy2PelletCount;
|
||||
|
||||
private float powerPelletDuration;
|
||||
private float[] scatterPattern;
|
||||
private float pelletTimeoutLimit;
|
||||
|
||||
// Power Pellet logic
|
||||
private bool powerPelletActive;
|
||||
private float powerPelletDuration;
|
||||
private float powerPelletCountdown;
|
||||
private int powerPelletMultiplier;
|
||||
|
||||
@@ -40,7 +43,6 @@ namespace Marro.PacManUdon
|
||||
|
||||
// Scattering logic
|
||||
private float scatterCounter;
|
||||
private float[] scatterPattern;
|
||||
private int scatterPatternIndex;
|
||||
|
||||
// Elroy logic
|
||||
@@ -51,12 +53,10 @@ namespace Marro.PacManUdon
|
||||
private int sharedPelletCounter;
|
||||
private readonly int[] sharedPelletCounterReleaseValues = { 0, 7, 17, 32 };
|
||||
private float pelletTimeout;
|
||||
private float pelletTimeoutLimit;
|
||||
|
||||
private bool frozen;
|
||||
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)
|
||||
{
|
||||
this.gameController = gameController;
|
||||
@@ -72,12 +72,11 @@ namespace Marro.PacManUdon
|
||||
Vector2 idlePosition2 = ghostTargets[2 + 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 Reset(bool afterLifeLost = false)
|
||||
public void RestartLevel(bool afterLifeLost = false)
|
||||
{
|
||||
ghostScaredQueue = new DataList();
|
||||
powerPelletActive = false;
|
||||
@@ -192,7 +191,9 @@ namespace Marro.PacManUdon
|
||||
gameController.GhostCaught(0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Debug.Log($"{gameObject} GhostCaughtQueue with ghost {ghost}");
|
||||
networkManager.SendEventSoon(NetworkEventType.GhostUpdate);
|
||||
ghostScaredQueue.Add(ghost);
|
||||
GhostCaughtExecute(ghost);
|
||||
}
|
||||
@@ -314,6 +315,18 @@ namespace Marro.PacManUdon
|
||||
public void SetLevel(int 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);
|
||||
speedScared = PacManConstants.GetGhostScaredSpeedForLevel(level);
|
||||
speedReturn = 15f;
|
||||
@@ -326,13 +339,6 @@ namespace Marro.PacManUdon
|
||||
powerPelletDuration = PacManConstants.GetScaredDurationForLevel(level);
|
||||
scatterPattern = PacManConstants.GetScatterPatternForLevel(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)
|
||||
@@ -478,11 +484,100 @@ namespace Marro.PacManUdon
|
||||
|
||||
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
|
||||
if (eventType != NetworkEventType.GhostUpdate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Power Pellet logic
|
||||
data.Append(powerPelletActive, ref index);
|
||||
data.Append(powerPelletCountdown, ref index);
|
||||
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]);
|
||||
}
|
||||
Debug.Log($"{gameObject} Read back a ghostScareQueue of length {ghostScaredQueue.Count}");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,22 +32,12 @@ namespace Marro.PacManUdon
|
||||
|
||||
public override void CollectSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
if (eventType != NetworkEventType.PacManTurn)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
data.Append(GetPosition(), ref index);
|
||||
data.Append(GetDirection(), ref index);
|
||||
}
|
||||
|
||||
public override bool WriteSyncedData(byte[] data, ref int index, NetworkEventType eventType)
|
||||
{
|
||||
if (eventType != NetworkEventType.PacManTurn)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
SetPosition(data.ReadVector2(ref index));
|
||||
SetDirection(data.ReadVector2(ref index));
|
||||
|
||||
|
||||
@@ -439,7 +439,7 @@ namespace Marro.PacManUdon
|
||||
var timestampBytes = BitConverter.GetBytes(timestamp);
|
||||
Array.Copy(timestampBytes, 0, data, HeaderTimestampIndex, timestampBytes.Length);
|
||||
data[HeaderEventIdIndex] = eventId;
|
||||
data[HeaderEventTypeIndex] = Int32ToByte((int)eventType);
|
||||
data[HeaderEventTypeIndex] = ((int)eventType).ToByte();
|
||||
index = HeaderLength;
|
||||
}
|
||||
|
||||
@@ -926,9 +926,6 @@ namespace Marro.PacManUdon
|
||||
Array.Copy(data, start, result, 0, length);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static byte Int32ToByte(int value) =>
|
||||
(byte)value; // Doing this inline causes an error...?
|
||||
#endregion
|
||||
|
||||
#region Debug
|
||||
@@ -969,6 +966,11 @@ namespace Marro.PacManUdon
|
||||
{
|
||||
SendEventSoon(NetworkEventType.SyncPellets);
|
||||
}
|
||||
|
||||
public void DoGhostSync()
|
||||
{
|
||||
SendEventSoon(NetworkEventType.GhostUpdate);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Marro.PacManUdon
|
||||
pacMan.SetPosition(attractScreenElements[16].transform.localPosition);
|
||||
pacMan.SetDirection(Vector2.left);
|
||||
|
||||
ghostManager.Reset();
|
||||
ghostManager.RestartLevel();
|
||||
ghostManager.SetLevel(2);
|
||||
ghostManager.SetKinematic(true);
|
||||
ghostManager.SetActive(true);
|
||||
|
||||
Reference in New Issue
Block a user