Working via NetworkManager
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
#define RECORDING_DEMO
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Marro.PacManUdon
|
||||
{
|
||||
using UdonSharp;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon;
|
||||
using VRC.SDK3.Components;
|
||||
using VRC.Udon.Common.Interfaces;
|
||||
|
||||
|
||||
enum PacManGhostType
|
||||
{
|
||||
@@ -73,7 +68,6 @@ namespace Marro.PacManUdon
|
||||
private int predefinedPathIndex;
|
||||
|
||||
int rngState;
|
||||
private Vector2 syncedPosition;
|
||||
private float speed;
|
||||
private Vector2 target;
|
||||
private bool offGrid;
|
||||
@@ -162,7 +156,7 @@ namespace Marro.PacManUdon
|
||||
}
|
||||
|
||||
Vector2 position = GetPosition();
|
||||
Vector2 nextPosition = GridMoverTools.GetNextPosition(position, direction, speed);
|
||||
Vector2 nextPosition = GridMoverTools.GetNextPosition(position, direction, speed, networkManager.SyncedDeltaTime);
|
||||
|
||||
nextPosition = ProcessNextPosition(position, nextPosition);
|
||||
|
||||
@@ -227,13 +221,13 @@ namespace Marro.PacManUdon
|
||||
{
|
||||
target = GetGridTarget(gridPosition);
|
||||
SetDirection(GetGridDirectionToTargetGreedy(availableDirections, gridPosition, target));
|
||||
nextPosition = GridMoverTools.GetNextPosition(gridPosition, direction, speed);
|
||||
nextPosition = GridMoverTools.GetNextPosition(gridPosition, direction, speed, networkManager.SyncedDeltaTime);
|
||||
// Debug.Log($"GetNextPosition at gridPosition {gridPosition} with direction {direction} and speed {speed} gives nextPosition {nextPosition}");
|
||||
}
|
||||
else if (availableDirections.Length == 1 && availableDirections[0] != direction)
|
||||
{
|
||||
SetDirection(availableDirections[0]);
|
||||
nextPosition = GridMoverTools.GetNextPosition(gridPosition, direction, speed);
|
||||
nextPosition = GridMoverTools.GetNextPosition(gridPosition, direction, speed, networkManager.SyncedDeltaTime);
|
||||
}
|
||||
// Debug.Log($"{gameObject} crossed tile center {gridPosition}, new target: {target}, new direction: {direction}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user