Compare commits

...

2 Commits

Author SHA1 Message Date
BOT Alex 4b228771e5 Merge branch 'main' of https://gitea.deprived.dev/Sveskejuice/fgm24 2024-02-28 14:50:20 +01:00
BOT Alex 792b5407d2 Rope now connects on join 2024-02-28 14:50:14 +01:00
2 changed files with 16 additions and 8 deletions

View File

@ -35,11 +35,10 @@ public class NetworkedGameSetup : NetworkBehaviour
bool isServer = SteamManager.IsServer || LocalManager.IsServer;
GameObject[] players;
players = SpawnPlayers(playerIds);
//if (isServer)
// players = SpawnPlayers(playerIds);
//else
// players = GetPlayers(playerIds);
if (isServer)
players = SpawnPlayers(playerIds);
else
players = GetPlayers(playerIds);
//StartCoroutine(LateSetupProcedue(players));
}

View File

@ -73,7 +73,7 @@ public class RopeSimulator : MonoBehaviour
public static RopeSimulator instance;
private bool IsInitialized => start == null || end == null;
private bool IsInitialized => !(start == null || end == null);
private void Awake()
{
@ -88,7 +88,7 @@ public class RopeSimulator : MonoBehaviour
GameManager.OnPlayersReady += PlayersReady;
}
private void Start()
private void OnEnable()
{
// Example of using rope builder
//rope = new RopeBuilder()
@ -243,6 +243,13 @@ public class RopeSimulator : MonoBehaviour
private void RebuildRopeColliders()
{
// Benjamin forgor... to assign
if (ropeCollidersParent == null)
{
var holder = new GameObject("RopeHolder");
ropeCollidersParent = holder.transform;
}
for (int i = 0; i < ropeCollidersParent.childCount; i++)
{
Destroy(ropeCollidersParent.GetChild(i));
@ -266,7 +273,7 @@ public class RopeSimulator : MonoBehaviour
private void Update()
{
if (IsInitialized)
if (!IsInitialized)
return;
colliderToSquezeForce.Clear();
@ -378,6 +385,8 @@ public class RopeSimulator : MonoBehaviour
private void OnDrawGizmos()
{
return;
if (IsInitialized) return;
if (!Application.isPlaying) return;