/// <summary> /// Move the visual guide to the targetted position /// </summary> /// <param name="_pos"></param> public void moveGuide(Vector3 _pos, AxisLineRenderer.AXIS _axis) { Vector3 pos = transform.position; switch (_axis) { case AxisLineRenderer.AXIS.X: pos.x = _pos.x; break; case AxisLineRenderer.AXIS.Y: pos.y = _pos.y; break; case AxisLineRenderer.AXIS.Z: pos.z = _pos.z; break; } visualCue.transform.localPosition = transform.InverseTransformPoint(pos); }
/// <summary> /// Move the visual guide to the targetted position /// </summary> /// <param name="_pos"></param> public void movObject(Vector3 _pos, AxisLineRenderer.AXIS _axis) { Vector3 pos = transform.position; switch (_axis) { case AxisLineRenderer.AXIS.X: pos.x = _pos.x; break; case AxisLineRenderer.AXIS.Y: pos.y = _pos.y; break; case AxisLineRenderer.AXIS.Z: pos.z = _pos.z; break; } transform.position = pos; visualCue.transform.localPosition = movementGuide.transform.localPosition; }