Kinda working refactor

This commit is contained in:
2026-01-05 20:10:13 +01:00
parent 2636e65e4d
commit 630dc5a176
3 changed files with 356 additions and 285 deletions

View File

@@ -424,9 +424,9 @@ namespace Marro.PacManUdon
public override void AppendSyncedData(byte[][] data, ref int offset, NetworkEventType eventType)
{
data[offset++] = new byte[] { Int32ToByte((int)gameState) };
data[offset++] = new byte[] { NetworkManager.Int32ToByte((int)gameState) };
data[offset++] = BitConverter.GetBytes(currentlyInTimeSequence);
data[offset++] = new byte[] { Int32ToByte((int)currentTimeSequence) };
data[offset++] = new byte[] { NetworkManager.Int32ToByte((int)currentTimeSequence) };
data[offset++] = BitConverter.GetBytes(timeSequenceProgress);
}
@@ -496,9 +496,5 @@ namespace Marro.PacManUdon
}
get => level;
}
public static byte Int32ToByte(int value) =>
(byte)value;
//byte.Parse(value.ToString()); // This is the only way I could find to cast an int to byte in Udon, a regular cast crashes in runtime...
}
}