Exemple #1
0
        public static string GetExePath()
        {
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
            if (isInit)
            {
                return(exeFilePath);
            }
            isInit = true;
            try
            {
                byte[] buf  = new byte[500];
                int    size = 0;


                if (HapticApi.TryGetExePath(buf, ref size))
                {
                    byte[] cleanedArray = SubArray(buf, 0, size);

                    exeFilePath = System.Text.Encoding.UTF8.GetString(cleanedArray).Trim();
                    return(exeFilePath);
                }
            }
            catch (Exception e)
            {
                BhapticsLogger.LogError(e.Message);
            }

            exeFilePath = "";

            return(exeFilePath);
#else
            return("");
#endif
        }