private void Awake() { positionSnap = GetComponent <SnapToTargetPosition>(); positionSnap.UseLocalPosition = true; scalable = GetComponent <Scalable>(); scalable.TargetScale = transform.localScale; }
// Use this for initialization void Awake() { InitializeFaderParts(); gripHandle.InteractableObjectGrabbed += OnGripGrabbed; gripHandle.InteractableObjectUngrabbed += OnGripUngrabbed; gripTransformSnap = gripTransform.GetComponent <SnapToTargetPosition>(); gripTransformSnap.enabled = false; }
protected override void OnPlugLocked() { positionSnap = LockedPlug.PlugTransform.GetComponent <SnapToTargetPosition>(); rotationSnap = LockedPlug.PlugTransform.GetComponent <SnapToTargetRotation>(); if (lockedPlugGrabber != null) { snapToSphereRoutine = SnapToSphere(); StartCoroutine(snapToSphereRoutine); } }
void Awake() { interactable = GetComponent <VRTK_InteractableObject>(); interactable.InteractableObjectGrabbed += OnGrabbed; interactable.InteractableObjectUngrabbed += OnUngrabbed; positionSnap = PlugTransform.GetComponent <SnapToTargetPosition>(); rotationSnap = PlugTransform.GetComponent <SnapToTargetRotation>(); plugColliderCenter = PlugTransform.GetComponent <CapsuleCollider>().center; plugColliderHeight = PlugTransform.GetComponent <CapsuleCollider>().height; GetComponent <CordFollower>().enabled = false; }
protected override void OnPlugLocked() { positionSnap = LockedPlug.PlugTransform.GetComponent <SnapToTargetPosition>(); rotationSnap = LockedPlug.PlugTransform.GetComponent <SnapToTargetRotation>(); if (lockedPlugGrabber != null) { snapToSocketRoutine = SnapToSocket(); StartCoroutine(snapToSocketRoutine); } if (GetComponent <CordDispenser>()) { GetComponent <CordDispenser>().Block(); } }