安卓10及以下不开震动

This commit is contained in:
xiaohui.wang 2023-02-07 19:07:08 +08:00
parent 8f6c6b9784
commit 1354870a77
3 changed files with 14 additions and 0 deletions

View File

@ -322,6 +322,12 @@ public class JoyPacCurrentcyAdSingle
_currentcyAdSinglePlugin.Call("nofityPush", delayTime); _currentcyAdSinglePlugin.Call("nofityPush", delayTime);
} }
public int getAndroidVersion()
{
return _currentcyAdSinglePlugin.Call<int>("getAndroidVersion");
}
} }
#endif #endif

View File

@ -12,7 +12,15 @@ public class VibrationManager : SingletonMonoBehaviour<VibrationManager> {
void Awake(){ void Awake(){
if(CheckInstance()){ if(CheckInstance()){
return; return;
}
#if UNITY_ANDROID
JoyPacCurrentcyAdSingle currAdSingleTemp = new JoyPacCurrentcyAdSingle();
if (currAdSingleTemp.getAndroidVersion() <= 10 && CryptoPrefs.GetInt("getAndroidVersion",0)==0)
{
SaveEnable(false);
CryptoPrefs.SetInt("getAndroidVersion", 10);
} }
#endif
isEnable = UsayaStorageManager.LoadOrDefault(UsayaStorageFilename.Settings_Data, Const.VibrationTag, true); isEnable = UsayaStorageManager.LoadOrDefault(UsayaStorageFilename.Settings_Data, Const.VibrationTag, true);
} }