add some extra assets FX and SFX
This commit is contained in:
111
Assets/Game Kit Controller/Scripts/Input/InputAxisWrapper.cs
Normal file
111
Assets/Game Kit Controller/Scripts/Input/InputAxisWrapper.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
using UnityEngine;
|
||||
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
using UnityEngine.InputSystem;
|
||||
#endif
|
||||
|
||||
public static class InputAxisWrapper
|
||||
{
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
private static InputAction moveAction;
|
||||
|
||||
private static InputAction lookAction;
|
||||
#endif
|
||||
|
||||
private static Vector2 smoothedMove = Vector2.zero;
|
||||
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
public static void InitializeMove (InputAction move)
|
||||
{
|
||||
if (move == null) {
|
||||
Debug.LogError ("InputAxisWrapper: move action not found");
|
||||
return;
|
||||
}
|
||||
|
||||
moveAction = move;
|
||||
moveAction.Enable ();
|
||||
}
|
||||
|
||||
public static void InitializeLook (InputAction look)
|
||||
{
|
||||
if (look == null) {
|
||||
Debug.LogError ("InputAxisWrapper: look action not found");
|
||||
return;
|
||||
}
|
||||
|
||||
lookAction = look;
|
||||
lookAction.Enable ();
|
||||
}
|
||||
#endif
|
||||
|
||||
public static float GetAxisHorizontal ()
|
||||
{
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
if (moveAction == null) return 0f;
|
||||
|
||||
return moveAction.ReadValue<Vector2> ().x;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
public static float GetAxisVertical ()
|
||||
{
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
if (moveAction == null) return 0f;
|
||||
|
||||
return moveAction.ReadValue<Vector2> ().y;
|
||||
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
public static Vector2 GetMoveAxis (float smoothSpeed)
|
||||
{
|
||||
Vector2 currentValue = Vector2.zero;
|
||||
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
currentValue = moveAction.ReadValue<Vector2> ();
|
||||
#endif
|
||||
|
||||
smoothedMove = Vector2.Lerp (smoothedMove, currentValue, smoothSpeed * Time.deltaTime);
|
||||
|
||||
if (currentValue.x == 0) {
|
||||
if (Mathf.Abs (smoothedMove.x) < 0.001f) {
|
||||
smoothedMove.x = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentValue.y == 0) {
|
||||
if (Mathf.Abs (smoothedMove.y) < 0.001f) {
|
||||
smoothedMove.y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return smoothedMove;
|
||||
}
|
||||
|
||||
public static void resetSmoothedGetMoveAxis ()
|
||||
{
|
||||
smoothedMove = Vector2.zero;
|
||||
}
|
||||
|
||||
public static Vector2 GetMoveRawAxis ()
|
||||
{
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
return moveAction.ReadValue<Vector2> ();
|
||||
#else
|
||||
return Vector2.zero;
|
||||
#endif
|
||||
}
|
||||
|
||||
public static Vector2 GetLookAxis ()
|
||||
{
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
return lookAction.ReadValue<Vector2> ();
|
||||
#else
|
||||
return Vector2.zero;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f41351620b22b17429be449ee21087db
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/InputAxisWrapper.cs
|
||||
uploadId: 889948
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/JoystickData.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/actionInputDelaySystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -11,7 +11,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/editButtonInput.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -11,7 +11,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/editControlPosition.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/editInputPanelInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/inputActionManager.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/inputDoubleClickEventSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -11,6 +11,10 @@ using UnityEngine.Events;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
using UnityEngine.InputSystem;
|
||||
#endif
|
||||
|
||||
#if REWIRED
|
||||
using Rewired;
|
||||
#endif
|
||||
@@ -223,6 +227,16 @@ public class inputManager : MonoBehaviour
|
||||
|
||||
void Awake ()
|
||||
{
|
||||
if (useNewInputSystem) {
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
mainKeyboard = Keyboard.current;
|
||||
|
||||
InputAxisWrapper.InitializeMove (moveActionReference.action);
|
||||
|
||||
InputAxisWrapper.InitializeLook (lookActionReference.action);
|
||||
#endif
|
||||
}
|
||||
|
||||
getComponentInstance ();
|
||||
}
|
||||
|
||||
@@ -621,6 +635,11 @@ public class inputManager : MonoBehaviour
|
||||
editInputMenu = newPlayerInputManager.getEditInputMenu ();
|
||||
}
|
||||
|
||||
public bool isUseNewInputSystemActive ()
|
||||
{
|
||||
return useNewInputSystem;
|
||||
}
|
||||
|
||||
public bool isUsingGamepad ()
|
||||
{
|
||||
return usingGamepad;
|
||||
@@ -1207,11 +1226,11 @@ public class inputManager : MonoBehaviour
|
||||
temporalAxesList.Add (temporalMultiAxesList [i].axes [j]);
|
||||
}
|
||||
|
||||
// print (temporalMultiAxesList [i].axesName + " " + temporalMultiAxesList [i].multiAxesEditPanelActive);
|
||||
// print (temporalMultiAxesList [i].axesName + " " + temporalMultiAxesList [i].multiAxesEditPanelActive);
|
||||
|
||||
multiAxes newMultiAxes = new multiAxes (temporalMultiAxesList [i]);
|
||||
|
||||
// print (newMultiAxes.axesName + " " + newMultiAxes.multiAxesEditPanelActive);
|
||||
// print (newMultiAxes.axesName + " " + newMultiAxes.multiAxesEditPanelActive);
|
||||
|
||||
newMultiAxes.axesName = temporalMultiAxesList [i].axesName;
|
||||
|
||||
@@ -1757,6 +1776,127 @@ public class inputManager : MonoBehaviour
|
||||
return false;
|
||||
}
|
||||
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
|
||||
Dictionary<KeyCode, Key> keyCache = new Dictionary<KeyCode, Key> ();
|
||||
|
||||
Keyboard mainKeyboard;
|
||||
|
||||
|
||||
bool getKey (Key newKey)
|
||||
{
|
||||
return mainKeyboard [newKey].isPressed;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool getKey (KeyCode keyCode)
|
||||
{
|
||||
if (keyCode == KeyCode.None) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
if (!keyCache.TryGetValue (keyCode, out var key)) {
|
||||
if (!System.Enum.TryParse<Key> (keyCode.ToString (), out key))
|
||||
return false;
|
||||
|
||||
keyCache [keyCode] = key;
|
||||
}
|
||||
|
||||
if (mainKeyboard [key].isPressed) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool getKeyDown (KeyCode keyCode)
|
||||
{
|
||||
if (keyCode == KeyCode.None) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
if (!keyCache.TryGetValue (keyCode, out var key)) {
|
||||
if (!System.Enum.TryParse<Key> (keyCode.ToString (), out key))
|
||||
return false;
|
||||
|
||||
keyCache [keyCode] = key;
|
||||
}
|
||||
|
||||
if (mainKeyboard [key].wasPressedThisFrame) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool getKeyUp (KeyCode keyCode)
|
||||
{
|
||||
if (keyCode == KeyCode.None) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
if (!keyCache.TryGetValue (keyCode, out var key)) {
|
||||
if (!System.Enum.TryParse<Key> (keyCode.ToString (), out key))
|
||||
return false;
|
||||
|
||||
keyCache [keyCode] = key;
|
||||
}
|
||||
|
||||
if (mainKeyboard [key].wasReleasedThisFrame) {
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public string horizontalString = "Horizontal";
|
||||
public string verticalString = "Vertical";
|
||||
|
||||
public string mouseXString = "Mouse X";
|
||||
public string mouseYString = "Mouse Y";
|
||||
|
||||
public bool useNewInputSystem;
|
||||
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
public InputActionReference moveActionReference;
|
||||
public InputActionReference lookActionReference;
|
||||
#endif
|
||||
|
||||
public float newInputSystemKeyboardAxisSmoothSpeed = 5;
|
||||
|
||||
public Vector2 getKeyboardAxisInputValue ()
|
||||
{
|
||||
if (useNewInputSystem) {
|
||||
return InputAxisWrapper.GetMoveAxis (newInputSystemKeyboardAxisSmoothSpeed);
|
||||
} else {
|
||||
return new Vector2 (Input.GetAxis (horizontalString), Input.GetAxis (verticalString));
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2 getKeyboardRawAxisInputValue ()
|
||||
{
|
||||
if (useNewInputSystem) {
|
||||
return InputAxisWrapper.GetMoveRawAxis ();
|
||||
} else {
|
||||
return new Vector2 (Input.GetAxisRaw (horizontalString), Input.GetAxisRaw (verticalString));
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2 getMouseAxisInputValue ()
|
||||
{
|
||||
if (useNewInputSystem) {
|
||||
return InputAxisWrapper.GetLookAxis ();
|
||||
} else {
|
||||
return new Vector2 (Input.GetAxis (mouseXString), Input.GetAxis (mouseYString));
|
||||
}
|
||||
}
|
||||
|
||||
//function called in the script where pressing that button will make an action in the game, for example jump, crouch, shoot, etc...
|
||||
//every button sends its action and the type of pressing
|
||||
public bool getKeyboardButtonFromMultiAxesList (int multiAxesIndex, int axesIndex, buttonType type, bool canBeUsedOnPausedGame)
|
||||
@@ -1820,49 +1960,91 @@ public class inputManager : MonoBehaviour
|
||||
switch (type) {
|
||||
//this key is for holding
|
||||
case buttonType.getKey:
|
||||
if (Input.GetKey (currentKeyCodeToCheck)) {
|
||||
if (useNewInputSystem) {
|
||||
if (getKey (currentKeyCodeToCheck)) {
|
||||
if (showKeyboardPressed) {
|
||||
print ("Get Key: " + currentKeyButtonToCheck.keyButton);
|
||||
}
|
||||
|
||||
if (showKeyboardPressed) {
|
||||
print ("Get Key: " + currentKeyButtonToCheck.keyButton);
|
||||
if (showKeyboardPressedAction) {
|
||||
print ("Action Name On Key: " + currentKeyButtonToCheck.Name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (Input.GetKey (currentKeyCodeToCheck)) {
|
||||
|
||||
if (showKeyboardPressedAction) {
|
||||
print ("Action Name On Key: " + currentKeyButtonToCheck.Name);
|
||||
if (showKeyboardPressed) {
|
||||
print ("Get Key: " + currentKeyButtonToCheck.keyButton);
|
||||
}
|
||||
|
||||
if (showKeyboardPressedAction) {
|
||||
print ("Action Name On Key: " + currentKeyButtonToCheck.Name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
//this key is for press once
|
||||
case buttonType.getKeyDown:
|
||||
if (Input.GetKeyDown (currentKeyCodeToCheck)) {
|
||||
if (useNewInputSystem) {
|
||||
if (getKeyDown (currentKeyCodeToCheck)) {
|
||||
if (showKeyboardPressed) {
|
||||
print ("Get Key Down: " + currentKeyButtonToCheck.keyButton);
|
||||
}
|
||||
|
||||
if (showKeyboardPressed) {
|
||||
print ("Get Key Down: " + currentKeyButtonToCheck.keyButton);
|
||||
if (showKeyboardPressedAction) {
|
||||
print ("Action Name On Key Down: " + currentKeyButtonToCheck.Name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (Input.GetKeyDown (currentKeyCodeToCheck)) {
|
||||
|
||||
if (showKeyboardPressedAction) {
|
||||
print ("Action Name On Key Down: " + currentKeyButtonToCheck.Name);
|
||||
if (showKeyboardPressed) {
|
||||
print ("Get Key Down: " + currentKeyButtonToCheck.keyButton);
|
||||
}
|
||||
|
||||
if (showKeyboardPressedAction) {
|
||||
print ("Action Name On Key Down: " + currentKeyButtonToCheck.Name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
//this key is for release
|
||||
case buttonType.getKeyUp:
|
||||
if (Input.GetKeyUp (currentKeyCodeToCheck)) {
|
||||
if (useNewInputSystem) {
|
||||
if (getKeyUp (currentKeyCodeToCheck)) {
|
||||
if (showKeyboardPressed) {
|
||||
print ("Get Key Up: " + currentKeyButtonToCheck.keyButton);
|
||||
}
|
||||
|
||||
if (showKeyboardPressed) {
|
||||
print ("Get Key Up: " + currentKeyButtonToCheck.keyButton);
|
||||
if (showKeyboardPressedAction) {
|
||||
print ("Action Name On Key Up: " + currentKeyButtonToCheck.Name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (Input.GetKeyUp (currentKeyCodeToCheck)) {
|
||||
|
||||
if (showKeyboardPressedAction) {
|
||||
print ("Action Name On Key Up: " + currentKeyButtonToCheck.Name);
|
||||
if (showKeyboardPressed) {
|
||||
print ("Get Key Up: " + currentKeyButtonToCheck.keyButton);
|
||||
}
|
||||
|
||||
if (showKeyboardPressedAction) {
|
||||
print ("Action Name On Key Up: " + currentKeyButtonToCheck.Name);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2028,7 +2210,7 @@ public class inputManager : MonoBehaviour
|
||||
currentTouch = Input.GetTouch (currentTouchIndex);
|
||||
}
|
||||
|
||||
if (currentTouch.phase == TouchPhase.Began) {
|
||||
if (currentTouch.phase == UnityEngine.TouchPhase.Began) {
|
||||
//if the button is pressed (OnPointerDown), return true
|
||||
//print ("getKeyDown");
|
||||
return true;
|
||||
@@ -2053,7 +2235,8 @@ public class inputManager : MonoBehaviour
|
||||
currentTouch = Input.GetTouch (currentTouchIndex);
|
||||
}
|
||||
|
||||
if (currentTouch.phase == TouchPhase.Stationary || currentTouch.phase == TouchPhase.Moved) {
|
||||
if (currentTouch.phase == UnityEngine.TouchPhase.Stationary ||
|
||||
currentTouch.phase == UnityEngine.TouchPhase.Moved) {
|
||||
//if the button is pressed OnPointerDown, and is not released yet (OnPointerUp), return true
|
||||
//print ("getKey");
|
||||
return true;
|
||||
@@ -2078,7 +2261,7 @@ public class inputManager : MonoBehaviour
|
||||
currentTouch = Input.GetTouch (currentTouchIndex);
|
||||
}
|
||||
|
||||
if (currentTouch.phase == TouchPhase.Ended) {
|
||||
if (currentTouch.phase == UnityEngine.TouchPhase.Ended) {
|
||||
//if the button is released (OnPointerUp), return true
|
||||
//print ("getKeyUp");
|
||||
return true;
|
||||
@@ -3715,6 +3898,10 @@ public class inputManager : MonoBehaviour
|
||||
|
||||
public KeyCode key = KeyCode.A;
|
||||
|
||||
#if ENABLE_INPUT_SYSTEM
|
||||
public Key keyInput;
|
||||
#endif
|
||||
|
||||
#if REWIRED
|
||||
[ActionIdProperty(typeof(RewiredConsts.Action))]
|
||||
public int rewiredAction = -1;
|
||||
|
||||
@@ -11,7 +11,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/inputManager.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/inputPanelUISystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/mouseCursorController.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/mouseOperations.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -67,6 +67,8 @@ public class playerInputManager : MonoBehaviour
|
||||
public bool usingTouchControls;
|
||||
public bool gameManagerPaused;
|
||||
|
||||
public bool useNewInputSystem;
|
||||
|
||||
public string horizontalString = "Horizontal";
|
||||
public string verticalString = "Vertical";
|
||||
public string mouseXString = "Mouse X";
|
||||
@@ -175,6 +177,9 @@ public class playerInputManager : MonoBehaviour
|
||||
|
||||
public List<touchButtonsInfo> touchButtonsInfoList = new List<touchButtonsInfo> ();
|
||||
|
||||
|
||||
string [] keyNumberListString = new string [] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||
|
||||
#if REWIRED
|
||||
private bool _useRewired;
|
||||
private IList<Player> _rewiredPlayers;
|
||||
@@ -283,6 +288,8 @@ public class playerInputManager : MonoBehaviour
|
||||
|
||||
usingGamepad = input.isUsingGamepad ();
|
||||
|
||||
useNewInputSystem = input.isUseNewInputSystemActive ();
|
||||
|
||||
if (usingKeyBoard || allowKeyboardAndGamepad || useOnlyKeyboard) {
|
||||
if (!usingTouchControls || (allowGamepadInTouchDevice && usingGamepad)) {
|
||||
|
||||
@@ -299,14 +306,24 @@ public class playerInputManager : MonoBehaviour
|
||||
}
|
||||
else {
|
||||
#endif
|
||||
movementAxis.x = Input.GetAxis (horizontalString);
|
||||
movementAxis.y = Input.GetAxis (verticalString);
|
||||
|
||||
mouseAxis.x = Input.GetAxis (mouseXString);
|
||||
mouseAxis.y = Input.GetAxis (mouseYString);
|
||||
if (useNewInputSystem) {
|
||||
movementAxis = input.getKeyboardAxisInputValue ();
|
||||
|
||||
mouseAxis = input.getMouseAxisInputValue ();
|
||||
|
||||
rawMovementAxis = input.getKeyboardRawAxisInputValue ();
|
||||
} else {
|
||||
movementAxis.x = Input.GetAxis (horizontalString);
|
||||
movementAxis.y = Input.GetAxis (verticalString);
|
||||
|
||||
mouseAxis.x = Input.GetAxis (mouseXString);
|
||||
mouseAxis.y = Input.GetAxis (mouseYString);
|
||||
|
||||
rawMovementAxis.x = Input.GetAxisRaw (horizontalString);
|
||||
rawMovementAxis.y = Input.GetAxisRaw (verticalString);
|
||||
}
|
||||
|
||||
rawMovementAxis.x = Input.GetAxisRaw (horizontalString);
|
||||
rawMovementAxis.y = Input.GetAxisRaw (verticalString);
|
||||
#if REWIRED
|
||||
}
|
||||
#endif
|
||||
@@ -781,8 +798,11 @@ public class playerInputManager : MonoBehaviour
|
||||
if (_useRewired)
|
||||
return new Vector2 (_rewiredPlayers[playerID - 1].GetAxis (horizontalString), _rewiredPlayers[playerID - 1].GetAxis (verticalString));
|
||||
#endif
|
||||
|
||||
return new Vector2 (Input.GetAxis (horizontalString), Input.GetAxis (verticalString));
|
||||
if (useNewInputSystem) {
|
||||
return input.getKeyboardAxisInputValue ();
|
||||
} else {
|
||||
return new Vector2 (Input.GetAxis (horizontalString), Input.GetAxis (verticalString));
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2 getRealMouseAxisInput ()
|
||||
@@ -791,8 +811,11 @@ public class playerInputManager : MonoBehaviour
|
||||
if (_useRewired)
|
||||
return new Vector2 (_rewiredPlayers[playerID - 1].GetAxis (mouseXString), _rewiredPlayers[playerID - 1].GetAxis (mouseYString));
|
||||
#endif
|
||||
|
||||
return new Vector2 (Input.GetAxis (mouseXString), Input.GetAxis (mouseYString));
|
||||
if (useNewInputSystem) {
|
||||
return input.getMouseAxisInputValue ();
|
||||
} else {
|
||||
return new Vector2 (Input.GetAxis (mouseXString), Input.GetAxis (mouseYString));
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2 getRealMouseRawAxisInput ()
|
||||
@@ -801,8 +824,11 @@ public class playerInputManager : MonoBehaviour
|
||||
if (_useRewired)
|
||||
return new Vector2 (_rewiredPlayers[playerID - 1].GetAxisRaw (mouseXString), _rewiredPlayers[playerID - 1].GetAxisRaw (mouseYString));
|
||||
#endif
|
||||
|
||||
return new Vector2 (Input.GetAxisRaw (mouseXString), Input.GetAxisRaw (mouseYString));
|
||||
if (useNewInputSystem) {
|
||||
return input.getKeyboardRawAxisInputValue ();
|
||||
} else {
|
||||
return new Vector2 (Input.GetAxisRaw (mouseXString), Input.GetAxisRaw (mouseYString));
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2 getRealMouseGamepadAxisInput ()
|
||||
@@ -922,7 +948,26 @@ public class playerInputManager : MonoBehaviour
|
||||
return input.checkPlayerInputButtonFromMultiAxesList (multiAxesStringIndex, axesStringIndex, buttonType, playerID, false, useOnlyKeyboard);
|
||||
}
|
||||
|
||||
string [] keyNumberListString = new string [] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||
public bool checkIfInputPressedByName (string inputName, inputManager.buttonType buttonType)
|
||||
{
|
||||
int axesStringIndex = -1;
|
||||
|
||||
for (int i = 0; i < currentMultiAxesCount; i++) {
|
||||
|
||||
currentMultiAxes = multiAxesList [i];
|
||||
|
||||
axesStringIndex = currentMultiAxes.axes.FindIndex (s => s.actionName.Equals (inputName));
|
||||
|
||||
if (axesStringIndex != -1) {
|
||||
return input.checkPlayerInputButtonFromMultiAxesList (
|
||||
currentMultiAxes.multiAxesStringIndex,
|
||||
currentMultiAxes.axes [axesStringIndex].axesStringIndex,
|
||||
buttonType, playerID, false, useOnlyKeyboard);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public int checkNumberInput (int numberAmount)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/playerInputManager.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/playerInputPanelSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/playerInputPauseSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/pressMultipleKeysActionInputSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/screenActionInfo.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/showPlayerInputValues.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/touchButtonColorChangeSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/touchButtonEventSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoImporter:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure FPS TPS Creator 3D +
|
||||
2.5D
|
||||
packageVersion: 3.77h
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Input/touchScreenPinchSystem.cs
|
||||
uploadId: 814740
|
||||
uploadId: 889948
|
||||
|
||||
Reference in New Issue
Block a user