|
|
|
@ -22,10 +22,12 @@ using Unity.GameCore; |
|
|
|
using UnityEngine.GameCore; |
|
|
|
#endif
|
|
|
|
|
|
|
|
public class MagnificentVoiceChat : MonoBehaviour |
|
|
|
public class EpicVoiceChatTest : MonoBehaviour |
|
|
|
{ |
|
|
|
// We intend to use predetermined lobby names generated from game-specific match/team/squad information,
|
|
|
|
// so to simulate this we use a static GUID here, as opposed to letting Epic's backend automatically generate a random lobby ID.
|
|
|
|
// This also allows multiple clients to connect to the same lobby without having to communicate the ID among each other.
|
|
|
|
private const string DebugLobbyId = "a0f6a51f-6b61-4c95-9ed8-a1d508fe4eb6"; |
|
|
|
private const string DebugBucketId = "foobar"; |
|
|
|
|
|
|
|
private readonly StringBuilder status = new StringBuilder("Status:\n"); |
|
|
|
|
|
|
|
@ -80,6 +82,7 @@ public class MagnificentVoiceChat : MonoBehaviour |
|
|
|
|
|
|
|
Debug.Log("Xbox Live services initialized."); |
|
|
|
|
|
|
|
// This delay is just here to give us some time to connect the debugger
|
|
|
|
yield return new WaitForSeconds(5f); |
|
|
|
#endif
|
|
|
|
|
|
|
|
@ -88,6 +91,7 @@ public class MagnificentVoiceChat : MonoBehaviour |
|
|
|
ProductName = "WW1Test", |
|
|
|
ProductVersion = "1.0.0.0", |
|
|
|
#if UNITY_GAMECORE
|
|
|
|
// EOS SDK on Game Core will not initialize without these memory management function pointers
|
|
|
|
AllocateMemoryFunction = Marshal.GetFunctionPointerForDelegate((EOSNativeHelper.AllocateMemoryFunc)EOSNativeHelper.AllocateMemory), |
|
|
|
ReallocateMemoryFunction = Marshal.GetFunctionPointerForDelegate((EOSNativeHelper.ReallocateMemoryFunc)EOSNativeHelper.ReallocateMemory), |
|
|
|
ReleaseMemoryFunction = Marshal.GetFunctionPointerForDelegate((EOSNativeHelper.ReleaseMemoryFunc)EOSNativeHelper.ReleaseMemory), |
|
|
|
@ -368,6 +372,8 @@ public class MagnificentVoiceChat : MonoBehaviour |
|
|
|
|
|
|
|
private void LoadLibrary() |
|
|
|
{ |
|
|
|
// EOS SDK 1.13 uses dynamic library binding in the Editor but does not provide any system functions to actually load dynamic libraries,
|
|
|
|
// so we need to provide those ourselves.
|
|
|
|
eosLbraryHandle = EOSNativeHelper.LoadLibrary($@"Assets\Plugins\EpicOnlineServices\Bin\{Config.LibraryName}.dll"); |
|
|
|
if (eosLbraryHandle == IntPtr.Zero) |
|
|
|
{ |
|
|
|
@ -413,7 +419,12 @@ public class MagnificentVoiceChat : MonoBehaviour |
|
|
|
|
|
|
|
private void OnGUI() |
|
|
|
{ |
|
|
|
GUI.matrix = Matrix4x4.Scale(new Vector3(2, 2, 1)); |
|
|
|
int screenHeight = Screen.currentResolution.height; |
|
|
|
if (screenHeight == 0) |
|
|
|
screenHeight = 1080; |
|
|
|
|
|
|
|
float screenScale = screenHeight / 720f; |
|
|
|
GUI.matrix = Matrix4x4.Scale(new Vector3(screenScale, screenScale, 1)); |
|
|
|
|
|
|
|
GUILayout.Label(status.ToString()); |
|
|
|
} |