VeriorPies / ParrelSync

(Unity3D) Test multiplayer without building
MIT License
4.51k stars 318 forks source link

Wiki Misleading #54

Closed Jriles closed 2 years ago

Jriles commented 2 years ago
#if UNITY_EDITOR
using UnityEngine;
using ParrelSync;

public class MyMultiplayerTestScript: MonoBehaviour
{
    void Start()
    {
        if (ClonesManager.IsClone()) 
        {
          // This is a clone project, connect to local host
        }
        else  
        { 
          // This is the original project, start server
        }
    }
}
#endif

Should be

#if UNITYEDITOR
using UnityEngine;
using ParrelSync;

public class MyMultiplayerTestScript: MonoBehaviour
{
    void Start()
    {
        if (ClonesManager.IsClone()) 
        {
          // This is a clone project, connect to local host
        }
        else  
        { 
          // This is the original project, start server
        }
    }
}
#endif

At least on my version of unity, 2020.3.17, UNITY_EDITOR didn't work for me and really slowed me down

Jriles commented 2 years ago

I arrived at this purely though accident