99.imdk_unity 上传

This commit is contained in:
2025-06-19 10:56:43 +08:00
parent d48c1f1f7b
commit 820c663ab8
651 changed files with 123674 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
//
// NativeLocation.h
// Immersal SDK
//
// Created by Mikko on 29/05/2020.
//
//
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import <UIKit/UIKit.h>
@interface NativeLocation : NSObject <CLLocationManagerDelegate>
- (NativeLocation *)init;
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations;
@end

View File

@@ -0,0 +1,81 @@
fileFormatVersion: 2
guid: 3047a557b77d947608c98b823c7d4d5b
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 1
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 0
- first:
Android: Android
second:
enabled: 0
settings:
AndroidSharedLibraryType: Executable
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
CPU: AnyCPU
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,132 @@
//
// NativeLocation.m
// Immersal SDK
//
// Created by Mikko on 29/05/2020.
//
//
#import "NativeLocation.h"
double latitude;
double longitude;
double altitude;
double haccuracy;
double vaccuracy;
@implementation NativeLocation
CLLocationManager *locationManager;
static bool isEnabled = NO;
- (NativeLocation *)init
{
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.distanceFilter = kCLDistanceFilterNone;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
[locationManager requestWhenInUseAuthorization];
return self;
}
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status;
{
/* switch (status) {
case kCLAuthorizationStatusAuthorizedWhenInUse:
case kCLAuthorizationStatusAuthorizedAlways:
isEnabled = YES; break;
default:
isEnabled = NO; break;
}*/
}
- (void)locationManager:(CLLocationManager*)manager didFailWithError:(NSError*)error;
{
isEnabled = NO;
}
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations;
{
CLLocation *location = [locations lastObject];
latitude = location.coordinate.latitude;
longitude = location.coordinate.longitude;
altitude = location.altitude;
haccuracy = location.horizontalAccuracy;
vaccuracy = location.verticalAccuracy;
isEnabled = YES;
//NSLog(@"lat: %f long: %f alt: %f", latitude, longitude, altitude);
}
- (void)start
{
if (locationManager != NULL) {
[locationManager startUpdatingLocation];
}
}
- (void)stop
{
if (locationManager != NULL) {
[locationManager stopUpdatingLocation];
}
isEnabled = NO;
}
@end
static NativeLocation* locationDelegate = NULL;
extern "C"
{
void startLocation()
{
if (locationDelegate == NULL) {
locationDelegate = [[NativeLocation alloc] init];
}
[locationDelegate start];
}
void stopLocation()
{
if (locationDelegate != NULL) {
[locationDelegate stop];
}
}
double getLatitude()
{
return latitude;
}
double getLongitude()
{
return longitude;
}
double getAltitude()
{
return altitude;
}
double getHorizontalAccuracy()
{
return haccuracy;
}
double getVerticalAccuracy()
{
return vaccuracy;
}
bool locationServicesEnabled()
{
return isEnabled;
}
}

View File

@@ -0,0 +1,37 @@
fileFormatVersion: 2
guid: d437760fb73c64fbea6c103e65c7b46a
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 1
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
iPhone: iOS
second:
enabled: 1
settings: {}
- first:
tvOS: tvOS
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,81 @@
fileFormatVersion: 2
guid: 4e5497290e47344189a08bc45a2d4ec6
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 1
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 0
- first:
Android: Android
second:
enabled: 0
settings:
AndroidSharedLibraryType: Executable
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
iPhone: iOS
second:
enabled: 1
settings:
AddToEmbeddedBinaries: false
CPU: AnyCPU
CompileFlags:
FrameworkDependencies: Security;
userData:
assetBundleName:
assetBundleVariant: