Esempio n. 1
0
        private void DiveOut()
        {
            // Fade the screen back in
            SteamVR_Fade.Start(Color.clear, currentFadeTime);

            // Scale up the agent using the scaling factor
            playerRoot.transform.localScale *= currentDT.scaleFactor;

            // Update the position of the agent
            //Vector3 feetOffset = player.trackingOriginTransform.position - player.feetPositionGuess;
            player.trackingOriginTransform.position = diveOutPos; //+ feetOffset;
            player.trackingOriginTransform.rotation = diveOutRot;

            // Free the agent's hands
            leftHand.Deactivate_sword();
            rightHand.Deactivate_sword();
            leftHand.DetachObject(leftHand.currentAttachedObject);
            rightHand.DetachObject(rightHand.currentAttachedObject);

            currentDT.DeactivateBow();

            // Finish the dive process
            currentDT = null;
            diving    = false;
            //Make Playroom Sound play
            SoundManagerScript.S.MakePlayroomSound();
            SoundManagerScript.S.StopBattleSound();
        }
Esempio n. 2
0
        public void TryTeleportPlayerToGodPosition()
        {
            //if (visible && !teleporting)
            //{

            //Pointing at an unlocked teleport marker
            teleportingToMarker     = godPosition;
            pointedAtTeleportMarker = godPosition;
            pointedAtPosition       = godPosition.transform.position;
            globalScaleOnTeleport   = globalScaleOnTeleportToMeta;

            lhand.Deactivate_sword();
            rhand.Deactivate_sword();
            rhand.DetachObject(rhand.currentAttachedObject);
            lhand.DetachObject(lhand.currentAttachedObject);

            if (godPosition.facingDirection != null)
            {
                player.trackingOriginTransform.rotation = godPosition.facingDirection.rotation;
            }

            InitiateTeleportFade();
            CancelTeleportHint();
        }