/// <summary>
 /// Event Handler when an error occurs
 /// </summary>
 /// <param name="error">The MLResultCode</param>
 /// <param name="errorString">String version of the error</param>
 private void HandleError(MLResultCode error, string errorString)
 {
     if (_statusText != null)
     {
         _statusText.text = errorString;
     }
 }
예제 #2
0
        public MLResult(MLResultCode resultCode, Func <MLResultCode, string> resultStringer)
        {
            if (resultStringer == null)
            {
                throw new ArgumentException("Result stringer parameter has invalid null value");
            }

            this.message = null;
            this.Result  = Code.NotImplemented;
        }
예제 #3
0
        public static string GetResultString(MLResultCode result)
        {
            // TODO: Support other media results.
            if (result >= MLResultCode.MediaGenericInvalidOperation &&
                result <= MLResultCode.MediaGenericUnexpectedNull)
            {
                return(result.ToString());
            }

            return(MagicLeapNativeBindings.MLGetResultString(result));
        }
        public static string MLGetResultString(MLResultCode result)
        {
            switch (result)
            {
            // TODO: Rename to include Code in string?
            case MLResultCode.Ok:
            { return("MLResult_Ok"); }

            case MLResultCode.Pending:
            { return("MLResult_Pending"); }

            case MLResultCode.Timeout:
            { return("MLResult_Timeout"); }

            case MLResultCode.Locked:
            { return("MLResult_Locked"); }

            case MLResultCode.UnspecifiedFailure:
            { return("MLResult_UnspecifiedFailure"); }

            case MLResultCode.InvalidParam:
            { return("MLResult_InvalidParam"); }

            case MLResultCode.AllocFailed:
            { return("MLResult_AllocFailed"); }

            case MLResultCode.PrivilegeDenied:
            { return("MLResult_PrivilegeDenied"); }

            case MLResultCode.NotImplemented:
            { return("MLResult_NotImplemented"); }

            case MLResultCode.NotCompatible:
            { return("MLResult_NotCompatible"); }

            case MLResultCode.SnapshotPoseNotFound:
            { return("MLResult_SnapshotPoseNotFound"); }

            default:
            { return("MLResult_Invalid"); }
            }
        }
        public static string GetResultString(MLResultCode resultCode)
        {
            string finalResult = "MLNetworking.GetResultString failed due to internal error";

            try
            {
                finalResult = "Use MLResult.CodeToString(MLResult.Code) instead.";
            }
            catch (System.DllNotFoundException)
            {
                MLPluginLog.Error("MLNetworking API is currently available only on device.");
                finalResult = "MLNetworking API is currently available only on device.";
            }
            catch (System.EntryPointNotFoundException)
            {
                MLPluginLog.Error("MLNetworking API symbols not found");
                finalResult = "MLNetworking API symbols not found";
            }

            return(finalResult);
        }
 public static string GetResultString(MLResultCode result)
 {
     return("This function is deprecated. Use MLResult.CodeToString(MLResult.Code) instead.");
 }
 public static string GetResultString(MLResultCode result)
 {
     return("");
 }
예제 #8
0
 /// <summary>
 /// Event Handler when an error occurs
 /// </summary>
 /// <param name="error">The MLResultCode</param>
 /// <param name="errorString">String version of the error</param>
 private void HandleError(MLResultCode error, string errorString)
 {
     Debug.LogErrorFormat("Error: ScreensExample received error from MediaPlayer: {0}.", errorString);
     DisplayVideoError();
 }
예제 #9
0
 public MLResult(MLResultCode resultCode)
 {
     this.message = MagicLeapNativeBindings.MLGetResultString(resultCode);
     this.Result  = Code.NotImplemented;
 }
예제 #10
0
 public MLResult(MLResultCode resultCode, string msg)
 {
     this.message = msg;
     this.Result  = Code.NotImplemented;
 }
예제 #11
0
 public static string GetResultString(MLResultCode resultCode)
 {
     return("This function is obsolete. Use MLResult.CodeToString(MLResult.Code) instead.");
 }