示例#1
0
        private void Awake()
        {
            positionSnap = GetComponent <SnapToTargetPosition>();
            positionSnap.UseLocalPosition = true;

            scalable             = GetComponent <Scalable>();
            scalable.TargetScale = transform.localScale;
        }
示例#2
0
文件: Fader.cs 项目: lane-s/ComposeVR
        // Use this for initialization
        void Awake()
        {
            InitializeFaderParts();

            gripHandle.InteractableObjectGrabbed   += OnGripGrabbed;
            gripHandle.InteractableObjectUngrabbed += OnGripUngrabbed;

            gripTransformSnap         = gripTransform.GetComponent <SnapToTargetPosition>();
            gripTransformSnap.enabled = false;
        }
示例#3
0
        protected override void OnPlugLocked()
        {
            positionSnap = LockedPlug.PlugTransform.GetComponent <SnapToTargetPosition>();
            rotationSnap = LockedPlug.PlugTransform.GetComponent <SnapToTargetRotation>();

            if (lockedPlugGrabber != null)
            {
                snapToSphereRoutine = SnapToSphere();
                StartCoroutine(snapToSphereRoutine);
            }
        }
示例#4
0
文件: Plug.cs 项目: lane-s/ComposeVR
        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;
        }
示例#5
0
        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();
            }
        }