mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-28 18:25:18 +00:00
le funny islands werent showing up for some reason
This commit is contained in:
parent
e69c74ae66
commit
b16710d923
@ -1,4 +1,5 @@
|
||||
using QSB.TornadoSync.TransformSync;
|
||||
using System.Linq;
|
||||
using QSB.TornadoSync.TransformSync;
|
||||
using QSB.TornadoSync.WorldObjects;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
@ -13,32 +14,51 @@ namespace QSB.TornadoSync
|
||||
{
|
||||
QSBWorldSync.Init<QSBTornado, TornadoController>();
|
||||
|
||||
if (!QSBCore.IsHost)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var transformSync in QSBWorldSync.GetWorldObjects<OccasionalTransformSync>())
|
||||
{
|
||||
QNetworkServer.Destroy(transformSync.gameObject);
|
||||
}
|
||||
|
||||
// islands
|
||||
foreach (var islandController in QSBWorldSync.GetWorldObjects<IslandController>())
|
||||
// cannon parts
|
||||
var mainCannonPart = GameObject.Find("OrbitalProbeCannon_Body").GetAttachedOWRigidbody();
|
||||
{
|
||||
var transformSync = Instantiate(QSBNetworkManager.Instance.OccasionalPrefab).GetComponent<OccasionalTransformSync>();
|
||||
transformSync.InitBodyIndexes(islandController._islandBody, Locator._giantsDeep.GetOWRigidbody());
|
||||
transformSync.InitBodyIndexes(mainCannonPart, Locator._giantsDeep.GetOWRigidbody());
|
||||
transformSync.gameObject.SpawnWithServerAuthority();
|
||||
}
|
||||
|
||||
// cannon parts
|
||||
foreach (var partName in new[]
|
||||
foreach (var cannonPartNames in new[]
|
||||
{
|
||||
"OrbitalProbeCannon_Body",
|
||||
"CannonBarrel_Body",
|
||||
"CannonMuzzle_Body",
|
||||
"Debris_Body (1)",
|
||||
"Debris_Body (2)"
|
||||
})
|
||||
{
|
||||
var cannonPart = GameObject.Find(cannonPartNames).GetAttachedOWRigidbody();
|
||||
var transformSync = Instantiate(QSBNetworkManager.Instance.OccasionalPrefab).GetComponent<OccasionalTransformSync>();
|
||||
transformSync.InitBodyIndexes(GameObject.Find(partName).GetAttachedOWRigidbody(),
|
||||
Locator._giantsDeep.GetOWRigidbody());
|
||||
transformSync.InitBodyIndexes(cannonPart, mainCannonPart);
|
||||
transformSync.gameObject.SpawnWithServerAuthority();
|
||||
}
|
||||
|
||||
// islands
|
||||
var islandControllers = QSBWorldSync.GetWorldObjects<IslandController>().ToArray();
|
||||
DebugLog.DebugWrite($"there are {islandControllers.Length} islandControllers");
|
||||
foreach (var islandNames in new[]
|
||||
{
|
||||
"GabbroIsland_Body",
|
||||
"StatueIsland_Body",
|
||||
"ConstructionYardIsland_Body",
|
||||
"BrambleIsland_Body"
|
||||
})
|
||||
{
|
||||
var island = GameObject.Find(islandNames).GetAttachedOWRigidbody();
|
||||
var transformSync = Instantiate(QSBNetworkManager.Instance.OccasionalPrefab).GetComponent<OccasionalTransformSync>();
|
||||
transformSync.InitBodyIndexes(island, Locator._giantsDeep.GetOWRigidbody());
|
||||
transformSync.gameObject.SpawnWithServerAuthority();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user