You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
428 B
C#
16 lines
428 B
C#
6 months ago
|
using UnityEngine;
|
||
|
using Autohand;
|
||
|
|
||
|
namespace Autohand.Demo{
|
||
|
public class MoverLever : PhysicsGadgetHingeAngleReader{
|
||
|
public Transform move;
|
||
|
public Vector3 axis;
|
||
|
public float speed = 1;
|
||
|
|
||
|
void Update(){
|
||
|
if(Mathf.Abs(GetValue()) > 0.1f)
|
||
|
move.position = Vector3.MoveTowards(move.position, move.position-axis, Time.deltaTime*speed*(GetValue()));
|
||
|
}
|
||
|
}
|
||
|
}
|