您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
47 行
1.4 KiB
47 行
1.4 KiB
#import <Foundation/NSProcessInfo.h>
|
|
|
|
#define EXPORT(_returnType_) extern "C" _returnType_ __attribute__ ((visibility ("default")))
|
|
|
|
namespace
|
|
{
|
|
// Values must match UnityEngine.XR.ARFoundation.Samples.ThermalStateForIOS.ThermalState
|
|
enum ThermalState
|
|
{
|
|
kThermalStateUnknown = 0,
|
|
kThermalStateNominal = 1,
|
|
kThermalStateFair = 2,
|
|
kThermalStateSerious = 3,
|
|
kThermalStateCritical = 4,
|
|
};
|
|
|
|
inline ThermalState ConvertThermalState(NSProcessInfoThermalState thermalState)
|
|
{
|
|
ThermalState returnValue;
|
|
|
|
switch (thermalState)
|
|
{
|
|
case NSProcessInfoThermalStateNominal:
|
|
returnValue = kThermalStateNominal;
|
|
break;
|
|
case NSProcessInfoThermalStateFair:
|
|
returnValue = kThermalStateFair;
|
|
break;
|
|
case NSProcessInfoThermalStateSerious:
|
|
returnValue = kThermalStateSerious;
|
|
break;
|
|
case NSProcessInfoThermalStateCritical:
|
|
returnValue = kThermalStateCritical;
|
|
break;
|
|
default:
|
|
returnValue = kThermalStateUnknown;
|
|
break;
|
|
}
|
|
|
|
return returnValue;
|
|
}
|
|
}
|
|
|
|
EXPORT(ThermalState) ARFoundationSamples_GetCurrentThermalState()
|
|
{
|
|
return ::ConvertThermalState([[NSProcessInfo processInfo] thermalState]);
|
|
}
|