mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +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.TornadoSync.WorldObjects;
|
||||||
using QSB.Utility;
|
using QSB.Utility;
|
||||||
using QSB.WorldSync;
|
using QSB.WorldSync;
|
||||||
@ -13,32 +14,51 @@ namespace QSB.TornadoSync
|
|||||||
{
|
{
|
||||||
QSBWorldSync.Init<QSBTornado, TornadoController>();
|
QSBWorldSync.Init<QSBTornado, TornadoController>();
|
||||||
|
|
||||||
|
if (!QSBCore.IsHost)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var transformSync in QSBWorldSync.GetWorldObjects<OccasionalTransformSync>())
|
foreach (var transformSync in QSBWorldSync.GetWorldObjects<OccasionalTransformSync>())
|
||||||
{
|
{
|
||||||
QNetworkServer.Destroy(transformSync.gameObject);
|
QNetworkServer.Destroy(transformSync.gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
// islands
|
// cannon parts
|
||||||
foreach (var islandController in QSBWorldSync.GetWorldObjects<IslandController>())
|
var mainCannonPart = GameObject.Find("OrbitalProbeCannon_Body").GetAttachedOWRigidbody();
|
||||||
{
|
{
|
||||||
var transformSync = Instantiate(QSBNetworkManager.Instance.OccasionalPrefab).GetComponent<OccasionalTransformSync>();
|
var transformSync = Instantiate(QSBNetworkManager.Instance.OccasionalPrefab).GetComponent<OccasionalTransformSync>();
|
||||||
transformSync.InitBodyIndexes(islandController._islandBody, Locator._giantsDeep.GetOWRigidbody());
|
transformSync.InitBodyIndexes(mainCannonPart, Locator._giantsDeep.GetOWRigidbody());
|
||||||
transformSync.gameObject.SpawnWithServerAuthority();
|
transformSync.gameObject.SpawnWithServerAuthority();
|
||||||
}
|
}
|
||||||
|
foreach (var cannonPartNames in new[]
|
||||||
// cannon parts
|
|
||||||
foreach (var partName in new[]
|
|
||||||
{
|
{
|
||||||
"OrbitalProbeCannon_Body",
|
|
||||||
"CannonBarrel_Body",
|
"CannonBarrel_Body",
|
||||||
"CannonMuzzle_Body",
|
"CannonMuzzle_Body",
|
||||||
"Debris_Body (1)",
|
"Debris_Body (1)",
|
||||||
"Debris_Body (2)"
|
"Debris_Body (2)"
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
|
var cannonPart = GameObject.Find(cannonPartNames).GetAttachedOWRigidbody();
|
||||||
var transformSync = Instantiate(QSBNetworkManager.Instance.OccasionalPrefab).GetComponent<OccasionalTransformSync>();
|
var transformSync = Instantiate(QSBNetworkManager.Instance.OccasionalPrefab).GetComponent<OccasionalTransformSync>();
|
||||||
transformSync.InitBodyIndexes(GameObject.Find(partName).GetAttachedOWRigidbody(),
|
transformSync.InitBodyIndexes(cannonPart, mainCannonPart);
|
||||||
Locator._giantsDeep.GetOWRigidbody());
|
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();
|
transformSync.gameObject.SpawnWithServerAuthority();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user