1using System.Collections;
2using System.Collections.Generic;
4using NaughtyAttributes;
14 [ShowIf(
"useCurve")]
public Vector3
rotateAxis = Vector3.right;
16 private float fingerDiameter = 0.01f;
30 var origin = transform.position;
31 var targetLocalpos = Vector3.zero;
32 var targetLocalEuler =
new Vector3(-20,0,0);
33 target.transform.localEulerAngles =
new Vector3(-20,0,0);
38 var direction = -
target.transform.up;
41 if (Physics.Raycast(origin, direction, out hit,
maxDistance) && hit.collider.gameObject.GetComponent<MeshRenderer>() && hit.collider.gameObject.GetComponent<MeshCollider>())
49 transform.InverseTransformPoint(origin) +
Vector3.down * (hit.distance - fingerDiameter), 0.3f);
50 targetLocalEuler =
target.transform.localEulerAngles;
51 Debug.DrawRay(origin, direction * hit.distance,
Color.yellow);
64 if (targetLocalpos ==
Vector3.zero)
70 direction = -
target.transform.up;
83 target.transform.localPosition = targetLocalpos;
84 target.transform.localEulerAngles = targetLocalEuler;
91 var fikfs = transform.parent.GetComponentsInChildren<
FastIKFabric>();
92 foreach (var fikf
in fikfs)
96 StartCoroutine(DelayedEnable(fikf));
100 fikf.ResolveNow =
false;
107 yield
return new WaitForSeconds(0.5f);
void SetTrackingState(bool enabled)