mirror of
https://github.com/nothke/quality-control.git
synced 2025-08-08 23:03:43 +00:00
Merge branch 'master' of https://github.com/nothke/quality-control
This commit is contained in:
@@ -52,6 +52,7 @@ public class CranePickDrop : MonoBehaviour
|
||||
if (state == State.Catching)
|
||||
{
|
||||
Debug.Assert(handlingBody, this);
|
||||
Debug.Assert(magnet, this);
|
||||
|
||||
magnet.strength = magnetStrength;
|
||||
|
||||
|
22
Assets/Scripts/LineAttachEnd.cs
Normal file
22
Assets/Scripts/LineAttachEnd.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class LineAttachEnd : MonoBehaviour
|
||||
{
|
||||
public Transform anchor;
|
||||
|
||||
LineRenderer _line;
|
||||
LineRenderer line { get { if (!_line) _line = GetComponent<LineRenderer>(); return _line; } }
|
||||
|
||||
private void Start()
|
||||
{
|
||||
line.useWorldSpace = true;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
line.SetPosition(0, transform.position);
|
||||
line.SetPosition(1, anchor.position);
|
||||
}
|
||||
}
|
11
Assets/Scripts/LineAttachEnd.cs.meta
Normal file
11
Assets/Scripts/LineAttachEnd.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1cb77b9d79ad78c4d94f551335084d76
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -18,16 +18,16 @@ public class SlidingCrane : MonoBehaviour
|
||||
public Transform testTgt;
|
||||
public Vector3 target;
|
||||
|
||||
public Rigidbody craneRail ;
|
||||
public Transform cradleTransform;
|
||||
public Rigidbody cradleRb;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
target = transform.position;
|
||||
|
||||
|
||||
xMotion.progress = 0.5f;
|
||||
}
|
||||
|
||||
void Update()
|
||||
void FixedUpdate()
|
||||
{
|
||||
if (testTgt)
|
||||
target = testTgt.position;
|
||||
@@ -44,12 +44,14 @@ public class SlidingCrane : MonoBehaviour
|
||||
yMotion.AccelerateTo(yTgt);
|
||||
|
||||
float x = Mathf.Lerp(-xRange, xRange, xMotion.progress);
|
||||
float y = yMotion.progress * yRange;
|
||||
float y = yMotion.progress * yRange - 3;
|
||||
|
||||
xMotion.Update(Time.deltaTime);
|
||||
yMotion.Update(Time.deltaTime);
|
||||
|
||||
yTransform.localPosition = new Vector3(0, 0, yMotion.progress * yRange);
|
||||
xTransform.localPosition = new Vector3(x, 0, 0);
|
||||
|
||||
//cradleRb.MovePosition(cradleTransform.position);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user