mirror of
https://github.com/nothke/quality-control.git
synced 2025-08-08 23:03:43 +00:00
Added interaction, hand, rigidbody dragging, picking up hammer
This commit is contained in:
8
Assets/Scripts/Interactables.meta
Normal file
8
Assets/Scripts/Interactables.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 433e1012444d2b845ba4765ede367e22
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
13
Assets/Scripts/Interactables/InteractableTest.cs
Normal file
13
Assets/Scripts/Interactables/InteractableTest.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Nothke.Interaction;
|
||||
|
||||
public class InteractableTest : Interactable
|
||||
{
|
||||
public override void Use(InteractionController im)
|
||||
{
|
||||
base.Use(im);
|
||||
Debug.Log("works!");
|
||||
}
|
||||
}
|
11
Assets/Scripts/Interactables/InteractableTest.cs.meta
Normal file
11
Assets/Scripts/Interactables/InteractableTest.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 429d0776ebbb12d4e8adc0328a254f36
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -11,15 +11,20 @@ public class SlidingCrane : MonoBehaviour
|
||||
public Transform xTransform;
|
||||
public Transform yTransform;
|
||||
|
||||
|
||||
public float yRange = 10;
|
||||
public float xRange = 5;
|
||||
|
||||
public Transform testTgt;
|
||||
public Vector3 target;
|
||||
|
||||
public Rigidbody craneRail ;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
target = transform.position;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Update()
|
||||
@@ -30,7 +35,6 @@ public class SlidingCrane : MonoBehaviour
|
||||
|
||||
Vector3 localTarget = transform.InverseTransformPoint(target);
|
||||
|
||||
|
||||
Vector2 targetPlanar = new Vector2(localTarget.x, localTarget.z);
|
||||
|
||||
float xTgt = Mathf.InverseLerp(-xRange, xRange, targetPlanar.x);
|
||||
|
Reference in New Issue
Block a user