blob: dea1431f841d393ae2705dd853b801018a0f6ec6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
#if UNITY_IPHONE_API
using System;
using System.Collections;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace UnityEngine
{
public sealed partial class iPhone
{
[System.Runtime.InteropServices.DllImport("__Internal")]
internal static extern void UnityNSObject_RetainObject(IntPtr obj);
[System.Runtime.InteropServices.DllImport("__Internal")]
internal static extern void UnityNSObject_ReleaseObject(IntPtr obj);
public sealed partial class NSError
{
[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern int UnityNSError_Code(IntPtr errorObj);
[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern IntPtr UnityNSError_Description(IntPtr errorObj);
[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern IntPtr UnityNSError_Reason(IntPtr errorObj);
private IntPtr _nativeError;
private NSError(IntPtr nativeError)
{
_nativeError = nativeError;
UnityNSObject_RetainObject(_nativeError);
}
~NSError()
{
UnityNSObject_ReleaseObject(_nativeError);
}
public static NSError CreateNSError(IntPtr nativeError)
{
return nativeError == IntPtr.Zero ? null : new NSError(nativeError);
}
public int code
{
get { return UnityNSError_Code(_nativeError); }
}
public string description
{
get { return Marshal.PtrToStringAnsi(UnityNSError_Description(_nativeError)); }
}
public string reason
{
get { return Marshal.PtrToStringAnsi(UnityNSError_Reason(_nativeError)); }
}
}
public sealed partial class NSNotification
{
[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern IntPtr UnityNSNotification_Name(IntPtr notificationObj);
private IntPtr _nativeNotification;
private NSNotification(IntPtr nativeNotification)
{
_nativeNotification = nativeNotification;
UnityNSObject_RetainObject(_nativeNotification);
}
~NSNotification()
{
UnityNSObject_ReleaseObject(_nativeNotification);
}
public static NSNotification CreateNSNotification(IntPtr nativeNotification)
{
return nativeNotification == IntPtr.Zero ? null : new NSNotification(nativeNotification);
}
public string name
{
get { return Marshal.PtrToStringAnsi(UnityNSNotification_Name(_nativeNotification)); }
}
}
}
}
#endif
|