fix(Telepathy): Use compiler symbols in Available (#3667)

* fix(Telepathy): Use compiler symbols in Available

* Added Comments
This commit is contained in:
MrGadget 2023-12-03 08:50:19 -05:00 committed by GitHub
parent 2885752890
commit 98dcffb701
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,11 +75,15 @@ void Awake()
Debug.Log("TelepathyTransport initialized!");
}
public override bool Available()
{
// C#'s built in TCP sockets run everywhere except on WebGL
return Application.platform != RuntimePlatform.WebGLPlayer;
}
// C#'s built in TCP sockets run everywhere except on WebGL
// Do not change this back to using Application.platform
// because that doesn't work in the Editor!
public override bool Available() =>
#if UNITY_WEBGL
false;
#else
true;
#endif
// client
private void CreateClient()