Removed most old networking stuff
This commit is contained in:
@@ -35,7 +35,6 @@ namespace Marro.PacManUdon
|
||||
[SerializeField] private int pelletCountOverride = -1;
|
||||
|
||||
private Maze maze;
|
||||
private VRCObjectPool pelletPool;
|
||||
private Intermission2Pole intermission2Pole;
|
||||
|
||||
private Animator mazeSpriteAnimator;
|
||||
@@ -65,14 +64,13 @@ namespace Marro.PacManUdon
|
||||
}
|
||||
|
||||
maze = mazes[0];
|
||||
pelletPool = maze.pelletContainer.GetComponent<VRCObjectPool>();
|
||||
mazeSpriteAnimator = maze.mazeSprite.GetComponent<Animator>();
|
||||
intermission2Pole = intermissionScreenElements[4].GetComponent<Intermission2Pole>();
|
||||
|
||||
ghostManager.Initialize(maze.ghostTargets, pacMan, this);
|
||||
pacMan.Initialize(playerInput, pelletPool, this);
|
||||
pacMan.Initialize(playerInput, this);
|
||||
bonusFruit.Initialize();
|
||||
pelletManager.Initialize(pelletPool);
|
||||
pelletManager.Initialize();
|
||||
statusDisplay.Initialize();
|
||||
playerInput.Initialize(this);
|
||||
soundManager.Initialize();
|
||||
@@ -114,7 +112,6 @@ namespace Marro.PacManUdon
|
||||
public void StartGameButtonPressed()
|
||||
{
|
||||
Debug.Log($"{gameObject} Start Game Button was pressed!");
|
||||
TakeOwnership();
|
||||
StartTimeSequence(PacManTimeSequence.StartNewGame);
|
||||
}
|
||||
|
||||
@@ -142,7 +139,7 @@ namespace Marro.PacManUdon
|
||||
{
|
||||
Debug.Log($"{gameObject} New level started!");
|
||||
|
||||
pelletCountTotal = pelletPool.Pool.Length;
|
||||
pelletCountTotal = pelletManager.PelletCount;
|
||||
pelletCountRemaining = pelletCountTotal;
|
||||
ghostManager.SetPelletsRemaining(pelletCountRemaining);
|
||||
ghostManager.NewLevel();
|
||||
@@ -283,7 +280,7 @@ namespace Marro.PacManUdon
|
||||
|
||||
void SetPelletsActive(bool active)
|
||||
{
|
||||
pelletPool.gameObject.SetActive(active);
|
||||
pelletManager.gameObject.SetActive(active);
|
||||
}
|
||||
|
||||
void SetMazeVisible(bool visible)
|
||||
@@ -365,20 +362,12 @@ namespace Marro.PacManUdon
|
||||
|
||||
public void DecrementLives()
|
||||
{
|
||||
if (!Networking.IsOwner(gameObject))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Debug.Log($"{gameObject} Decremented lives from {extraLives} to {extraLives - 1}");
|
||||
SetExtraLives(extraLives - 1);
|
||||
}
|
||||
|
||||
void IncrementLives()
|
||||
{
|
||||
if (!Networking.IsOwner(gameObject))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Debug.Log($"{gameObject} Incremented lives from {extraLives} to {extraLives + 1}");
|
||||
SetExtraLives(extraLives + 1);
|
||||
}
|
||||
@@ -409,14 +398,6 @@ namespace Marro.PacManUdon
|
||||
}
|
||||
}
|
||||
|
||||
void TakeOwnership()
|
||||
{
|
||||
Networking.SetOwner(Networking.LocalPlayer, gameObject);
|
||||
Networking.SetOwner(Networking.LocalPlayer, pacMan.gameObject);
|
||||
Networking.SetOwner(Networking.LocalPlayer, pelletPool.gameObject);
|
||||
ghostManager.SetOwner(Networking.LocalPlayer);
|
||||
}
|
||||
|
||||
public override void AppendSyncedData(byte[][] data, ref int offset, NetworkEventType eventType)
|
||||
{
|
||||
data[offset++] = new byte[] { NetworkManager.Int32ToByte((int)gameState) };
|
||||
|
||||
Reference in New Issue
Block a user