Added Humanoid prefab and ControllerDebugger script
This commit is contained in:
parent
8309596f07
commit
3055ba5d30
7719
Runtime/HumanoidFree/Prefabs/Humanoid.prefab
Normal file
7719
Runtime/HumanoidFree/Prefabs/Humanoid.prefab
Normal file
File diff suppressed because it is too large
Load Diff
8
Runtime/HumanoidFree/Prefabs/Humanoid.prefab.meta
Normal file
8
Runtime/HumanoidFree/Prefabs/Humanoid.prefab.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b09ff8d1366440649b959c12df4d1076
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName: possessions
|
||||||
|
assetBundleVariant:
|
66
Runtime/Tools/Input/ControllerDebugger.cs
Normal file
66
Runtime/Tools/Input/ControllerDebugger.cs
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
using Passer;
|
||||||
|
|
||||||
|
public class ControllerDebugger : MonoBehaviour {
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public struct ControllerSideDebugger {
|
||||||
|
public float stickHorizontal;
|
||||||
|
public float stickVertical;
|
||||||
|
public bool stickButton;
|
||||||
|
public bool stickTouch;
|
||||||
|
|
||||||
|
public float touchpadHorizontal;
|
||||||
|
public float touchpadVertical;
|
||||||
|
public bool touchpadButton;
|
||||||
|
public bool touchpadTouch;
|
||||||
|
|
||||||
|
public bool[] buttons;
|
||||||
|
|
||||||
|
public float bumper;
|
||||||
|
public float trigger;
|
||||||
|
|
||||||
|
public bool option;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ControllerSideDebugger left;
|
||||||
|
public ControllerSideDebugger right;
|
||||||
|
|
||||||
|
private Controller controller;
|
||||||
|
|
||||||
|
private void Start () {
|
||||||
|
controller = Controllers.GetController(0);
|
||||||
|
|
||||||
|
left.buttons = new bool[4];
|
||||||
|
right.buttons = new bool[4];
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Update () {
|
||||||
|
UpdateSide(ref left, controller.left);
|
||||||
|
UpdateSide(ref right, controller.right);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateSide(ref ControllerSideDebugger sideDebugger, ControllerSide controllerSide) {
|
||||||
|
sideDebugger.stickHorizontal = controllerSide.stickHorizontal;
|
||||||
|
sideDebugger.stickVertical = controllerSide.stickVertical;
|
||||||
|
sideDebugger.stickButton = controllerSide.stickButton;
|
||||||
|
sideDebugger.stickTouch = controllerSide.stickTouch;
|
||||||
|
|
||||||
|
sideDebugger.touchpadHorizontal = controllerSide.touchpadHorizontal;
|
||||||
|
sideDebugger.touchpadVertical = controllerSide.touchpadVertical;
|
||||||
|
sideDebugger.touchpadButton = controllerSide.touchpadPress;
|
||||||
|
sideDebugger.touchpadTouch = controllerSide.touchpadTouch;
|
||||||
|
|
||||||
|
sideDebugger.buttons[0] = controllerSide.buttons[0];
|
||||||
|
sideDebugger.buttons[1] = controllerSide.buttons[1];
|
||||||
|
sideDebugger.buttons[2] = controllerSide.buttons[2];
|
||||||
|
sideDebugger.buttons[3] = controllerSide.buttons[3];
|
||||||
|
|
||||||
|
sideDebugger.bumper = controllerSide.trigger1;
|
||||||
|
sideDebugger.trigger = controllerSide.trigger2;
|
||||||
|
|
||||||
|
sideDebugger.option = controllerSide.option;
|
||||||
|
}
|
||||||
|
}
|
12
Runtime/Tools/Input/ControllerDebugger.cs.meta
Normal file
12
Runtime/Tools/Input/ControllerDebugger.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 339fe09701c7fab46b4cfea98038d938
|
||||||
|
timeCreated: 1461443022
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
x
Reference in New Issue
Block a user