Skip to content

Commit 6d5719e

Browse files
authored
修改IOSNative.cs的namespace为global::
1 parent bd2e783 commit 6d5719e

1 file changed

Lines changed: 72 additions & 74 deletions

File tree

iOSNative.cs

Lines changed: 72 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
using System;
1+
using System;
22
using System.Collections;
33
using System.Collections.Generic;
44
using System.Runtime.InteropServices;
55
using UnityEngine;
6-
namespace PM.iOS
6+
public class iOSNative
77
{
8-
9-
public class iOSNative
10-
{
118
#if UNITY_IOS && !UNITY_EDITOR
129
[DllImport("__Internal")]
1310
private static extern void _initialize();
@@ -64,156 +61,157 @@ public class iOSNative
6461
[DllImport("__Internal")]
6562
private static extern bool _iCloudSaveBool(string key, bool value);
6663
#endif
67-
public static void Initialize(){
64+
public static void Initialize()
65+
{
6866
#if UNITY_IOS && !UNITY_EDITOR
6967
_initialize();
7068
#endif
71-
}
69+
}
7270

73-
public static void _ShowTempAlert(string alertString, int duration = 5)
74-
{
71+
public static void ShowTempAlert(string alertString, int duration = 5)
72+
{
7573
#if UNITY_IOS && !UNITY_EDITOR
7674
_ShowTempAlert(alertString, duration);
7775
#endif
78-
}
76+
}
7977

80-
public static bool Synchronize()
81-
{
78+
public static bool Synchronize()
79+
{
8280
#if UNITY_IOS && !UNITY_EDITOR
8381
return _Synchronize();
8482
#else
85-
return default(bool);
83+
return default(bool);
8684
#endif
87-
}
88-
public static bool IsICloudAvailable()
89-
{
85+
}
86+
public static bool IsICloudAvailable()
87+
{
9088
#if UNITY_IOS && !UNITY_EDITOR
9189
return _IsICloudAvailable();
9290
#else
93-
return default(bool);
91+
return default(bool);
9492
#endif
95-
}
96-
/// <summary>
97-
/// PlayHaptics
98-
/// </summary>
99-
/// <param name="style">0 = Light, 1=Medium, 2=Heavy</param>
100-
/// <param name="intensity">Intensity 0.0 - 1.0</param>
101-
public static void PlayHaptics(int style, float intensity)//0 = Light, 1=Medium, 2=Heavy; Intensity 0.0 - 1.0
102-
{
93+
}
94+
/// <summary>
95+
/// PlayHaptics
96+
/// </summary>
97+
/// <param name="style">0 = Light, 1=Medium, 2=Heavy</param>
98+
/// <param name="intensity">Intensity 0.0 - 1.0</param>
99+
public static void PlayHaptics(int style, float intensity)//0 = Light, 1=Medium, 2=Heavy; Intensity 0.0 - 1.0
100+
{
103101
#if UNITY_IOS && !UNITY_EDITOR
104102
_PlayHaptics(style, intensity);
105103
#endif
106-
}
104+
}
107105

108106

109-
public static void Share(string message, string url = "", string imagePath = "", Action closeCallback = null)
110-
{
107+
public static void Share(string message, string url = "", string imagePath = "", Action closeCallback = null)
108+
{
111109
#if UNITY_IOS && !UNITY_EDITOR
112110
_Share(message, url, imagePath);
113111
#endif
114-
iOSCallbackHelper.INSTANCE.SetShareCloseCallback(closeCallback);
115-
}
116-
public static void PushNotification(string msg, string title, string identifier, int delay){
112+
iOSCallbackHelper.INSTANCE.SetShareCloseCallback(closeCallback);
113+
}
114+
public static void PushNotification(string msg, string title, string identifier, int delay)
115+
{
117116
#if UNITY_IOS && !UNITY_EDITOR
118117
_PushNotification(msg, title, identifier, delay);
119118
#endif
120-
}
121-
public static void RemovePendingNotifications(string identifier){
119+
}
120+
public static void RemovePendingNotifications(string identifier)
121+
{
122122
#if UNITY_IOS && !UNITY_EDITOR
123123
_RemovePendingNotifications(identifier);
124124
#endif
125-
}
126-
public static void RemoveAllPendingNotifications(){
125+
}
126+
public static void RemoveAllPendingNotifications()
127+
{
127128
#if UNITY_IOS && !UNITY_EDITOR
128129
_RemoveAllPendingNotifications();
129130
#endif
130-
}
131+
}
131132

132133

133134

134135

135136

136-
public static bool ClearICloudSave()
137-
{
137+
public static bool ClearICloudSave()
138+
{
138139
#if UNITY_IOS && !UNITY_EDITOR
139140
return _ClearICloudSave();
140141
#else
141-
return default(bool);
142+
return default(bool);
142143
#endif
143-
}
144+
}
144145

145-
public static string iCloudGetStringValue(string key, string defaultValue)
146-
{
146+
public static string iCloudGetStringValue(string key, string defaultValue)
147+
{
147148
#if UNITY_IOS && !UNITY_EDITOR
148149
return _iCloudGetString(key, defaultValue);
149150
#else
150-
return default(string);
151+
return default(string);
151152
#endif
152-
}
153+
}
153154

154-
public static bool iCloudSaveStringValue(string key, string value)
155-
{
155+
public static bool iCloudSaveStringValue(string key, string value)
156+
{
156157
#if UNITY_IOS && !UNITY_EDITOR
157158
return _iCloudSaveString(key, value);
158159
#else
159-
return default(bool);
160+
return default(bool);
160161
#endif
161-
}
162+
}
162163

163-
public static int iCloudGetIntValue(string key, int defaultValue)
164-
{
164+
public static int iCloudGetIntValue(string key, int defaultValue)
165+
{
165166
#if UNITY_IOS && !UNITY_EDITOR
166167
return _iCloudGetInt(key, defaultValue);
167168
#else
168-
return default(int);
169+
return default(int);
169170
#endif
170-
}
171+
}
171172

172-
public static bool iCloudSaveIntValue(string key, int value)
173-
{
173+
public static bool iCloudSaveIntValue(string key, int value)
174+
{
174175
#if UNITY_IOS && !UNITY_EDITOR
175176
return _iCloudSaveInt(key, value);
176177
#else
177-
return default(bool);
178+
return default(bool);
178179
#endif
179-
}
180+
}
180181

181-
public static float iCloudGetFloatValue(string key, float defaultValue)
182-
{
182+
public static float iCloudGetFloatValue(string key, float defaultValue)
183+
{
183184
#if UNITY_IOS && !UNITY_EDITOR
184185
return _iCloudGetFloat(key, defaultValue);
185186
#else
186-
return default(float);
187+
return default(float);
187188
#endif
188-
}
189+
}
189190

190-
public static bool iCloudSaveFloatValue(string key, float value)
191-
{
191+
public static bool iCloudSaveFloatValue(string key, float value)
192+
{
192193
#if UNITY_IOS && !UNITY_EDITOR
193194
return _iCloudSaveFloat(key, value);
194195
#else
195-
return default(bool);
196+
return default(bool);
196197
#endif
197-
}
198+
}
198199

199-
public static bool iCloudGetBoolValue(string key, bool defaultValue)
200-
{
200+
public static bool iCloudGetBoolValue(string key, bool defaultValue)
201+
{
201202
#if UNITY_IOS && !UNITY_EDITOR
202203
return _iCloudGetBool(key, defaultValue);
203204
#else
204-
return default(bool);
205+
return default(bool);
205206
#endif
206-
}
207+
}
207208

208-
public static bool iCloudSaveBoolValue(string key, bool value)
209-
{
209+
public static bool iCloudSaveBoolValue(string key, bool value)
210+
{
210211
#if UNITY_IOS && !UNITY_EDITOR
211212
return _iCloudSaveBool(key, value);
212213
#else
213-
return default(bool);
214+
return default(bool);
214215
#endif
215-
}
216216
}
217-
218217
}
219-

0 commit comments

Comments
 (0)