From 7b4dd5e329523385f6e26bc5815b1bc7b3f453a3 Mon Sep 17 00:00:00 2001 From: machcam <167964376+machcam@users.noreply.github.com> Date: Wed, 9 Jul 2025 11:47:08 +0700 Subject: [PATCH] COR-5684: support unity example for macos work with embedded lib --- unity/Assets/Plugins/Emotiv-Unity-Plugin | 2 +- unity/Assets/SimpleExample.cs | 19 +++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/unity/Assets/Plugins/Emotiv-Unity-Plugin b/unity/Assets/Plugins/Emotiv-Unity-Plugin index b209332..5dd8321 160000 --- a/unity/Assets/Plugins/Emotiv-Unity-Plugin +++ b/unity/Assets/Plugins/Emotiv-Unity-Plugin @@ -1 +1 @@ -Subproject commit b2093324127b9471b4ea895bf0f5953ee83a1dc8 +Subproject commit 5dd8321eb86e253935249b68e91aa27d464ce494 diff --git a/unity/Assets/SimpleExample.cs b/unity/Assets/SimpleExample.cs index 02afd01..8d75631 100644 --- a/unity/Assets/SimpleExample.cs +++ b/unity/Assets/SimpleExample.cs @@ -137,29 +137,24 @@ private static void RequestPermission(string permissionName) { void Start() { - #if USE_EMBEDDED_LIB - #if UNITY_STANDALONE_WIN && !UNITY_EDITOR + + #if USE_EMBEDDED_LIB && UNITY_STANDALONE_WIN && !UNITY_EDITOR string[] args = Environment.GetCommandLineArgs(); if (args.Length > 1) { _eItf.ProcessCallback(args[1]); return; } - #else - // Only for desktop with embedded cortex library for standalone windows - UnityEngine.Debug.Log("Only support embedded lib for for standalone windows."); - return; - #endif - #endif +#endif - #if UNITY_ANDROID +#if UNITY_ANDROID StartEmotivUnityItfForAndroid(); - # elif UNITY_IOS +#elif UNITY_IOS UnityEngine.Debug.Log("SimpleExp: Start EmotivUnityItf for ios"); _eItf.Init(AppConfig.ClientId, AppConfig.ClientSecret, AppConfig.AppName, AppConfig.AllowSaveLogToFile, AppConfig.IsDataBufferUsing); _eItf.Start(); - #else - UnityEngine.Debug.Log("SimpleExp: Start EmotivUnityItf for desktop " + AppConfig.AppUrl); +#else + UnityEngine.Debug.Log("SimpleExp: Start EmotivUnityItf for desktop " + AppConfig.AppUrl); _eItf.Init(AppConfig.ClientId, AppConfig.ClientSecret, AppConfig.AppName, AppConfig.AllowSaveLogToFile, AppConfig.IsDataBufferUsing, AppConfig.AppUrl); _eItf.Start(); _isEmotivUnityItfInitialized = true;