2using System.Collections;
3using System.Collections.Generic;
8using Sirenix.OdinInspector;
19[RequireComponent(typeof(DistanceGrabbable))]
32 public bool IsPulling {
get;
internal set; }
42 public virtual void Awake()
68 _initialPosition = _transformToMove.position;
69 _intitialRotation = _transformToMove.rotation;
75 if (longPressEvent.
Button != CommonButton.gripButton)
129 float deltaMove = -moveDirection * Time.deltaTime *
_zoomInSpeed;
136 if (distance <= MIN_DISTANCE && deltaMove > 0)
154 if (hand.holdingObj !=
null ||
IsPulling)
184 if (hand.holdingObj !=
null)
209 if (Camera.main !=
null)
211 Vector3 lookPosition = _transformToMove.position - Camera.main.transform.position;
216 _transformToMove.rotation = Quaternion.LookRotation(lookPosition);
220 _transformToMove.rotation = Quaternion.LookRotation(Vector3.Scale(lookPosition,
new Vector3(-1, -1, -1)));
float GetCurrentHandYAxis()
Hand _currentSelectingHand
Quaternion _intitialRotation
void OnStartTargeting(Hand hand, Grabbable grabbable)
Quaternion _rotationOnGrab
Transform _previousParent
virtual void OnTriggerGrab(Hand hand, Grabbable grabbable)
void OnTriggerPressed(Hand hand)
Transform _transformToMove
[SerializeField]
void OnStopTargeting(Hand hand, Grabbable grabbable)
void OnTriggerReleased(Hand hand)
DistanceGrabbable _distanceGrabbable
[SerializeField]
RotationOnRelease _rotationOnRelease
[SerializeField]
InputListener _inputListener
bool _invertedForward
[SerializeField]
virtual void OnTriggerReleased(Hand hand, Grabbable grabbable)
float _zoomInSpeed
[SerializeField]
virtual void StopTargeting()
virtual void StartTargeting()
void MoveAlongRay(float moveDirection)
Intentionally made partial, in case you want to extend it easily.
Unity components communication service.
Transform RespawnTransform