//---- public void activateRelevantWeapons(Hand hand) { if (swordPoint) { hand.Activate_sword(); } }
private IEnumerator DiveIn(Hand divingHand, float fadeTime) { yield return(new WaitForSeconds(fadeTime)); // Fade the screen back in SteamVR_Fade.Start(Color.clear, currentFadeTime); // Fix the current position diveOutPos = player.trackingOriginTransform.position; diveOutRot = player.trackingOriginTransform.rotation; // Scale down the agent using the inverse of the scaling factor player.transform.localScale *= (1f / nextDT.scaleFactor); // Update the position of the agent //Vector3 feetOffset = player.trackingOriginTransform.position - player.feetPositionGuess; player.trackingOriginTransform.position = nextDT.divePos.position;// + feetOffset; //update the rotation to match divePos Debug.Log("Rotation update " + nextDT + " " + nextDT.divePos + " " + nextDT.divePos.rotation, nextDT.divePos); player.trackingOriginTransform.rotation = nextDT.divePos.rotation; // Spawn the sword if necessary if (nextDT.swordTarget) { divingHand.Activate_sword(); } //Activate the bow if necessary if (nextDT.archeryTarget) { nextDT.ActivateBow(); } // Finish the dive process currentDT = nextDT; nextDT = null; diving = false; //Start Battle Music SoundManagerScript.S.StopPlayroomSound(); SoundManagerScript.S.MakeBattleSound(); }