예제 #1
0
        public void Collapse()
        {
            Flow    = 0;
            Flowing = false;

            collapsing = true;

            Plug plugA = A.GetComponentInActor <Plug>();
            Plug plugB = B.GetComponentInActor <Plug>();

            collapseStart = 0;
            collapseEnd   = path.Count - 1;

            if (plugA != null)
            {
                CordFollower followerA = plugA.GetComponent <CordFollower>();
                followerA.enabled = true;
                followerA.TeleportToPoint(0);
                followerA.SetTargetPoint(path.Count - 1);
                followerA.NextPointReached += OnStartPointConsumed;
                plugA.GetComponent <VRTK_InteractableObject>().isGrabbable = false;
            }

            if (plugB != null)
            {
                CordFollower followerB = plugB.GetComponent <CordFollower>();
                followerB.enabled = true;
                followerB.TeleportToPoint(path.Count - 1);
                followerB.SetTargetPoint(0);
                followerB.NextPointReached += OnEndPointConsumed;
                plugB.GetComponent <VRTK_InteractableObject>().isGrabbable = false;
            }
        }
예제 #2
0
        private void ShowHandle()
        {
            GetComponent <MeshRenderer>().enabled = true;
            GetComponent <Collider>().enabled     = true;

            cordFollower.TeleportToPoint(closestCordPointIndex);

            wasShowing = true;
        }