Added interaction, hand, rigidbody dragging, picking up hammer

This commit is contained in:
nothke
2024-08-18 13:21:38 +02:00
parent 93ecc95bfa
commit d2c3dff101
76 changed files with 5079 additions and 4 deletions

View File

@@ -0,0 +1,44 @@
using UnityEngine;
namespace Nothke.Interaction.Example
{
public class ExampleInteractionControllerInput : MonoBehaviour
{
public InteractionController controller;
public Items.Hands hands;
public int interactMouseButton = 0;
public int rayModeChangeMouseButton = 1;
public KeyCode dropKey = KeyCode.Q;
public KeyCode throwKey = KeyCode.F;
public KeyCode examineKey = KeyCode.E;
public KeyCode placeKey = KeyCode.T;
private void Update()
{
controller.SetInput(
Input.GetMouseButtonDown(interactMouseButton),
Input.GetMouseButtonUp(interactMouseButton),
Input.GetMouseButtonDown(rayModeChangeMouseButton));
if (hands)
{
hands.SetInput(new Items.Hands.HandsInput()
{
useDown = Input.GetMouseButtonDown(0),
useUp = Input.GetMouseButtonUp(0),
dropDown = Input.GetKeyDown(dropKey),
throwDown = Input.GetKeyDown(throwKey),
throwUp = Input.GetKeyUp(throwKey),
examineDown = Input.GetKeyDown(examineKey),
examineUp = Input.GetKeyUp(examineKey),
placeDown = Input.GetKeyDown(placeKey)
});
}
controller.UpdateInput();
controller.UpdateRaycast();
}
}
}

View File

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