feat: added fmod
This commit is contained in:
parent
c803300dce
commit
3471c31c32
416 changed files with 39455 additions and 171 deletions
92
Assets/Plugins/FMOD/src/PlatformMobileHigh.cs
Normal file
92
Assets/Plugins/FMOD/src/PlatformMobileHigh.cs
Normal file
|
@ -0,0 +1,92 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace FMODUnity
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
[InitializeOnLoad]
|
||||
#endif
|
||||
public class PlatformMobileHigh : PlatformMobileLow
|
||||
{
|
||||
static PlatformMobileHigh()
|
||||
{
|
||||
Settings.AddPlatformTemplate<PlatformMobileHigh>("fd7c55dab0fce234b8c25f6ffca523c1");
|
||||
}
|
||||
|
||||
public override string DisplayName { get { return "High-End Mobile"; } }
|
||||
#if UNITY_EDITOR
|
||||
public override Legacy.Platform LegacyIdentifier { get { return Legacy.Platform.MobileHigh; } }
|
||||
#endif
|
||||
|
||||
public override float Priority { get { return base.Priority + 1; } }
|
||||
|
||||
public override bool MatchesCurrentEnvironment
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!Active)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#if UNITY_IOS
|
||||
switch (UnityEngine.iOS.Device.generation)
|
||||
{
|
||||
case UnityEngine.iOS.DeviceGeneration.iPad1Gen:
|
||||
case UnityEngine.iOS.DeviceGeneration.iPad2Gen:
|
||||
case UnityEngine.iOS.DeviceGeneration.iPad3Gen:
|
||||
case UnityEngine.iOS.DeviceGeneration.iPadMini1Gen:
|
||||
case UnityEngine.iOS.DeviceGeneration.iPhone:
|
||||
case UnityEngine.iOS.DeviceGeneration.iPhone3G:
|
||||
case UnityEngine.iOS.DeviceGeneration.iPhone3GS:
|
||||
case UnityEngine.iOS.DeviceGeneration.iPhone4:
|
||||
case UnityEngine.iOS.DeviceGeneration.iPhone4S:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
#elif UNITY_ANDROID
|
||||
if (SystemInfo.processorCount <= 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (SystemInfo.processorCount >= 8)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// check the clock rate on quad core systems
|
||||
string freqinfo = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq";
|
||||
try
|
||||
{
|
||||
using (System.IO.TextReader reader = new System.IO.StreamReader(freqinfo))
|
||||
{
|
||||
string line = reader.ReadLine();
|
||||
int khz = int.Parse(line) / 1000;
|
||||
if (khz >= 1600)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue