Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Update YoutubeBoombox.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
steven4547466 committed Dec 9, 2023
1 parent 613b5f7 commit f7cfb51
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions YoutubeBoombox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,26 +188,26 @@ async void Awake()
}
});

CommandHandler.CommandHandler.RegisterCommand("spawnbox", (string[] args) =>
{
NetworkManager manager = FindObjectOfType<NetworkManager>();
if (manager != null)
{
foreach (NetworkPrefab prefab in manager.NetworkConfig.Prefabs.Prefabs)
{
if (prefab.Prefab.TryGetComponent(out BoomboxItem boombox))
{
BoomboxItem spawnedBox = Instantiate(boombox, StartOfRound.Instance.localPlayerController.transform.position, default);
spawnedBox.insertedBattery.charge = 0.2f;
spawnedBox.GetComponent<NetworkObject>().Spawn();

spawnedBox.SyncBatteryServerRpc(20);

break;
}
}
}
});
//CommandHandler.CommandHandler.RegisterCommand("spawnbox", (string[] args) =>
//{
// NetworkManager manager = FindObjectOfType<NetworkManager>();
// if (manager != null)
// {
// foreach (NetworkPrefab prefab in manager.NetworkConfig.Prefabs.Prefabs)
// {
// if (prefab.Prefab.TryGetComponent(out BoomboxItem boombox))
// {
// BoomboxItem spawnedBox = Instantiate(boombox, StartOfRound.Instance.localPlayerController.transform.position, default);
// spawnedBox.insertedBattery.charge = 0.2f;
// spawnedBox.GetComponent<NetworkObject>().Spawn();

// spawnedBox.SyncBatteryServerRpc(20);

// break;
// }
// }
// }
//});
}

private void SetupNetworking()
Expand Down

0 comments on commit f7cfb51

Please sign in to comment.