mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-25 02:55:15 +00:00
JoyShockLibrary (#213)
Fix PlayerInput.cs errors on MacOS Fix libraries not being added to the final build
This commit is contained in:
parent
0d59431efb
commit
3ddb77a906
10 changed files with 200 additions and 6 deletions
BIN
.DS_Store
vendored
Normal file
BIN
.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Assets/.DS_Store
vendored
Normal file
BIN
Assets/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Assets/Plugins/.DS_Store
vendored
Normal file
BIN
Assets/Plugins/.DS_Store
vendored
Normal file
Binary file not shown.
|
@ -11,6 +11,24 @@ PluginImporter:
|
||||||
isExplicitlyReferenced: 0
|
isExplicitlyReferenced: 0
|
||||||
validateReferences: 1
|
validateReferences: 1
|
||||||
platformData:
|
platformData:
|
||||||
|
- first:
|
||||||
|
: Any
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
Exclude Android: 0
|
||||||
|
Exclude Editor: 0
|
||||||
|
Exclude Linux64: 0
|
||||||
|
Exclude OSXUniversal: 0
|
||||||
|
Exclude Win: 0
|
||||||
|
Exclude Win64: 0
|
||||||
|
Exclude iOS: 0
|
||||||
|
- first:
|
||||||
|
Android: Android
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: ARMv7
|
||||||
- first:
|
- first:
|
||||||
Any:
|
Any:
|
||||||
second:
|
second:
|
||||||
|
@ -19,10 +37,11 @@ PluginImporter:
|
||||||
- first:
|
- first:
|
||||||
Editor: Editor
|
Editor: Editor
|
||||||
second:
|
second:
|
||||||
enabled: 0
|
enabled: 1
|
||||||
settings:
|
settings:
|
||||||
CPU: x86_64
|
CPU: x86_64
|
||||||
DefaultValueInitialized: true
|
DefaultValueInitialized: true
|
||||||
|
OS: AnyOS
|
||||||
- first:
|
- first:
|
||||||
Standalone: Linux64
|
Standalone: Linux64
|
||||||
second:
|
second:
|
||||||
|
@ -32,13 +51,13 @@ PluginImporter:
|
||||||
- first:
|
- first:
|
||||||
Standalone: OSXUniversal
|
Standalone: OSXUniversal
|
||||||
second:
|
second:
|
||||||
enabled: 0
|
enabled: 1
|
||||||
settings:
|
settings:
|
||||||
CPU: x86_64
|
CPU: AnyCPU
|
||||||
- first:
|
- first:
|
||||||
Standalone: Win
|
Standalone: Win
|
||||||
second:
|
second:
|
||||||
enabled: 0
|
enabled: 1
|
||||||
settings:
|
settings:
|
||||||
CPU: None
|
CPU: None
|
||||||
- first:
|
- first:
|
||||||
|
@ -47,6 +66,15 @@ PluginImporter:
|
||||||
enabled: 1
|
enabled: 1
|
||||||
settings:
|
settings:
|
||||||
CPU: AnyCPU
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
iPhone: iOS
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
AddToEmbeddedBinaries: false
|
||||||
|
CPU: AnyCPU
|
||||||
|
CompileFlags:
|
||||||
|
FrameworkDependencies:
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|
BIN
Assets/Plugins/JSL/.DS_Store
vendored
Normal file
BIN
Assets/Plugins/JSL/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Assets/Plugins/JSL/x64/libJoyShockLibrary.dylib
Executable file
BIN
Assets/Plugins/JSL/x64/libJoyShockLibrary.dylib
Executable file
Binary file not shown.
80
Assets/Plugins/JSL/x64/libJoyShockLibrary.dylib.meta
Normal file
80
Assets/Plugins/JSL/x64/libJoyShockLibrary.dylib.meta
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 53ce567e644ef4880b1db00e550aa797
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 1
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
: Any
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
Exclude Android: 0
|
||||||
|
Exclude Editor: 0
|
||||||
|
Exclude Linux64: 1
|
||||||
|
Exclude OSXUniversal: 0
|
||||||
|
Exclude Win: 1
|
||||||
|
Exclude Win64: 1
|
||||||
|
Exclude iOS: 0
|
||||||
|
- first:
|
||||||
|
Android: Android
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: ARMv7
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
OS: AnyOS
|
||||||
|
- first:
|
||||||
|
Standalone: Linux64
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: None
|
||||||
|
- first:
|
||||||
|
Standalone: OSXUniversal
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
Standalone: Win
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: x86
|
||||||
|
- first:
|
||||||
|
Standalone: Win64
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: x86_64
|
||||||
|
- first:
|
||||||
|
iPhone: iOS
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
AddToEmbeddedBinaries: false
|
||||||
|
CPU: AnyCPU
|
||||||
|
CompileFlags:
|
||||||
|
FrameworkDependencies:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -6,9 +6,30 @@ PluginImporter:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
iconMap: {}
|
iconMap: {}
|
||||||
executionOrder: {}
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
isPreloaded: 0
|
isPreloaded: 0
|
||||||
isOverridable: 0
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
platformData:
|
platformData:
|
||||||
|
- first:
|
||||||
|
: Any
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
Exclude Android: 1
|
||||||
|
Exclude Editor: 0
|
||||||
|
Exclude Linux64: 1
|
||||||
|
Exclude OSXUniversal: 0
|
||||||
|
Exclude Win: 1
|
||||||
|
Exclude Win64: 1
|
||||||
|
Exclude iOS: 1
|
||||||
|
- first:
|
||||||
|
Android: Android
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: ARMv7
|
||||||
- first:
|
- first:
|
||||||
Any:
|
Any:
|
||||||
second:
|
second:
|
||||||
|
@ -19,7 +40,15 @@ PluginImporter:
|
||||||
second:
|
second:
|
||||||
enabled: 1
|
enabled: 1
|
||||||
settings:
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
DefaultValueInitialized: true
|
DefaultValueInitialized: true
|
||||||
|
OS: AnyOS
|
||||||
|
- first:
|
||||||
|
Standalone: Linux64
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: None
|
||||||
- first:
|
- first:
|
||||||
Standalone: OSXIntel
|
Standalone: OSXIntel
|
||||||
second:
|
second:
|
||||||
|
@ -34,7 +63,29 @@ PluginImporter:
|
||||||
Standalone: OSXUniversal
|
Standalone: OSXUniversal
|
||||||
second:
|
second:
|
||||||
enabled: 1
|
enabled: 1
|
||||||
settings: {}
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
- first:
|
||||||
|
Standalone: Win
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: x86
|
||||||
|
- first:
|
||||||
|
Standalone: Win64
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: x86_64
|
||||||
|
- first:
|
||||||
|
iPhone: iOS
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
AddToEmbeddedBinaries: false
|
||||||
|
CPU: AnyCPU
|
||||||
|
CompileFlags:
|
||||||
|
FrameworkDependencies:
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|
BIN
Assets/Scripts/.DS_Store
vendored
Normal file
BIN
Assets/Scripts/.DS_Store
vendored
Normal file
Binary file not shown.
|
@ -87,6 +87,17 @@ namespace HeavenStudio
|
||||||
|
|
||||||
public static InputController GetInputController(int player)
|
public static InputController GetInputController(int player)
|
||||||
{
|
{
|
||||||
|
// Needed so Keyboard works on MacOS
|
||||||
|
#if UNITY_EDITOR_OSX
|
||||||
|
inputDevices = new List<InputController>();
|
||||||
|
if(inputDevices.Count < 1)
|
||||||
|
{
|
||||||
|
InputKeyboard keyboard = new InputKeyboard();
|
||||||
|
keyboard.SetPlayer(1);
|
||||||
|
keyboard.InitializeController();
|
||||||
|
inputDevices.Add(keyboard);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
//select input controller that has player field set to player
|
//select input controller that has player field set to player
|
||||||
//this will return the first controller that has that player number in the case of controller pairs (eg. Joy-Cons)
|
//this will return the first controller that has that player number in the case of controller pairs (eg. Joy-Cons)
|
||||||
//so such controllers should have a reference to the other controller in the pair
|
//so such controllers should have a reference to the other controller in the pair
|
||||||
|
@ -106,6 +117,19 @@ namespace HeavenStudio
|
||||||
//this will return the first controller that has that player number in the case of controller pairs (eg. Joy-Cons)
|
//this will return the first controller that has that player number in the case of controller pairs (eg. Joy-Cons)
|
||||||
//so such controllers should have a reference to the other controller in the pair
|
//so such controllers should have a reference to the other controller in the pair
|
||||||
//controller IDs are determined by connection order (the Keyboard is always first)
|
//controller IDs are determined by connection order (the Keyboard is always first)
|
||||||
|
|
||||||
|
|
||||||
|
// Needed so Keyboard works on MacOS
|
||||||
|
#if UNITY_EDITOR_OSX
|
||||||
|
inputDevices = new List<InputController>();
|
||||||
|
if(inputDevices.Count < 1)
|
||||||
|
{
|
||||||
|
InputKeyboard keyboard = new InputKeyboard();
|
||||||
|
keyboard.SetPlayer(1);
|
||||||
|
keyboard.InitializeController();
|
||||||
|
inputDevices.Add(keyboard);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
for (int i = 0; i < inputDevices.Count; i++)
|
for (int i = 0; i < inputDevices.Count; i++)
|
||||||
{
|
{
|
||||||
if (inputDevices[i].GetPlayer() == player)
|
if (inputDevices[i].GetPlayer() == player)
|
||||||
|
@ -118,6 +142,17 @@ namespace HeavenStudio
|
||||||
|
|
||||||
public static void UpdateInputControllers()
|
public static void UpdateInputControllers()
|
||||||
{
|
{
|
||||||
|
// Needed so Keyboard works on MacOS
|
||||||
|
#if UNITY_EDITOR_OSX
|
||||||
|
inputDevices = new List<InputController>();
|
||||||
|
if(inputDevices.Count < 1)
|
||||||
|
{
|
||||||
|
InputKeyboard keyboard = new InputKeyboard();
|
||||||
|
keyboard.SetPlayer(1);
|
||||||
|
keyboard.InitializeController();
|
||||||
|
inputDevices.Add(keyboard);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
foreach (InputController i in inputDevices)
|
foreach (InputController i in inputDevices)
|
||||||
{
|
{
|
||||||
i.UpdateState();
|
i.UpdateState();
|
||||||
|
|
Loading…
Reference in a new issue