Imported basic unity packages yeehaw

This commit is contained in:
Jan Groß
2021-06-11 23:22:35 +02:00
parent cebcde471d
commit 09c5e64772
312 changed files with 40946 additions and 276 deletions

View File

@@ -0,0 +1,35 @@
/*
The PlayerInput component has an auto-switch control scheme action that allows automatic changing of connected devices.
IE: Switching from Keyboard to Gamepad in-game.
When built to a mobile phone; in most cases, there is no concept of switching connected devices as controls are typically driven through what is on the device's hardware (Screen, Tilt, etc)
In Input System 1.0.2, if the PlayerInput component has Auto Switch enabled, it will search the mobile device for connected devices; which is very costly and results in bad performance.
This is fixed in Input System 1.1.
For the time-being; this script will disable a PlayerInput's auto switch control schemes; when project is built to mobile.
*/
using UnityEngine;
#if ENABLE_INPUT_SYSTEM && STARTER_ASSETS_PACKAGES_CHECKED
using UnityEngine.InputSystem;
#endif
public class MobileDisableAutoSwitchControls : MonoBehaviour
{
#if ENABLE_INPUT_SYSTEM && (UNITY_IOS || UNITY_ANDROID) && STARTER_ASSETS_PACKAGES_CHECKED
[Header("Target")]
public PlayerInput playerInput;
void Start()
{
DisableAutoSwitchControls();
}
void DisableAutoSwitchControls()
{
playerInput.neverAutoSwitchControlSchemes = true;
}
#endif
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 901182334643ba1438a25accc6bd0c79
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: