first push!

This commit is contained in:
2026-02-20 17:53:43 +01:00
parent ab073a6a39
commit e723ab86b9
274 changed files with 89671 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
#if UNITY_IOS
using UnityEditor.Callbacks;
using UnityEditor;
using UnityEditor.iOS.Xcode;
using System.IO;
public class BluetoothPostProcessBuild
{
[PostProcessBuild]
public static void ChangeXcodePlist(BuildTarget buildTarget, string pathToBuiltProject)
{
if (buildTarget == BuildTarget.iOS)
{
// Get plist
string plistPath = pathToBuiltProject + "/Info.plist";
PlistDocument plist = new PlistDocument();
plist.ReadFromString(File.ReadAllText(plistPath));
// Get root
PlistElementDict rootDict = plist.root;
rootDict.SetString("NSBluetoothAlwaysUsageDescription", "Uses BLE to communicate with devices.");
// Write to file
File.WriteAllText(plistPath, plist.WriteToString());
}
}
}
#endif

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 1695b640ed1354053a8cdd9e0186f57f
timeCreated: 1493664761
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,93 @@
#!/usr/bin/perl
use File::Copy;
print ("\n*** Starting PostprocessBuildPlayer ***\n");
my $installPath = $ARGV[0];
#values to watch for already existing
my $requiredDeviceCapsString = "UIRequiredDeviceCapabilities";
my $backgroundModesString = "UIBackgroundModes";
my $bluetoothLEString = "bluetooth-le";
#go through the info.plist file line by line until you find this one:
my $endOfPlist = "</dict>";
# The type of player built:
# "dashboard", "standaloneWin32", "standaloneOSXIntel", "standaloneOSXPPC", "standaloneOSXUniversal", "webplayer", "iPhone"
my $target = $ARGV[1];
print ("\n*** PostprocessBuildPlayer - Building at '$installPath' with target: $target ***\n");
################################################################
# This modifies info.plist to add the external accessory #
# entries #
################################################################
#open this file
$oplistPath = $installPath."/Info.plist";
$nplistPath = $installPath."/Info.plist.tmp";
open OLDPLIST, "<", $oplistPath or die("Cannot open Info.plist");
open NEWPLIST, ">", $nplistPath or die("Cannot create new Info.plist");
my $nextLine = 0;
my $requiredDeviceCapsFound = 0;
my $backgroundModesFound = 0;
while(<OLDPLIST>)
{
if ($nextLine == 1)
{
if ($_ =~ m/$bluetoothLEString/)
{
}
else
{
$_ =~ s|</array>|\n\t<string>bluetooth-le</string></array>|
}
$nextLine = 0;
}
################################################################
# Check for required device caps string already exists #
################################################################
if ($_ =~ m/$requiredDeviceCapsString/ )
{
$nextLine = 1;
}
################################################################
# Check for background modes string already exists #
################################################################
if ($_ =~ m/$backgroundModesString/ )
{
$backgroundModesFound = 1;
}
################################################################
# Add any key/value pairs you want at the end of Info.plist #
################################################################
if ($_ =~ m/$endOfPlist/ && $backgrounModesFound == 0)
{
my $keys = "";
$keys .= " <key>UIBackgroundModes</key>\n";
$keys .= " <array>\n";
$keys .= " <string>bluetooth-central</string>\n";
$keys .= " <string>bluetooth-peripheral</string>\n";
$keys .= " </array>\n";
$_ = $keys . $_;
}
print NEWPLIST $_;
}
close OLDPLIST;
close NEWPLIST;
`mv \'$nplistPath\' \'$oplistPath\'`;

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 3c726eecf85fe4a88a7e7d57812ff455
timeCreated: 1515198229
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: