Skip to content

Commit 26da55b

Browse files
author
lawwong
committed
Fix Teleportable.UseSteamVRFade is not working
1 parent 175016c commit 26da55b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/Teleportable.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,9 @@ protected virtual void OnPointerTeleport(PointerEventData eventData)
246246

247247
abort = false;
248248

249-
if (useSteamVRFade && fadeDuration > 0f && VRModule.isSteamVRPluginDetected && VRModule.activeModule != VRModuleActiveEnum.SteamVR)
249+
if (useSteamVRFade && fadeDuration > 0f && !VRModule.isSteamVRPluginDetected)
250250
{
251251
Debug.LogWarning("Install SteamVR plugin and enable SteamVRModule support to enable fading");
252-
fadeDuration = 0f;
253252
}
254253

255254
var delay = Mathf.Max(0f, fadeDuration * 0.5f);
@@ -277,7 +276,7 @@ protected bool IsValidTeleportButton(PointerEventData eventData)
277276

278277
public IEnumerator StartTeleport(RaycastResult hitResult, Vector3 position, Quaternion rotation, float delay)
279278
{
280-
if (VRModule.activeModule == VRModuleActiveEnum.SteamVR && !Mathf.Approximately(delay, 0f))
279+
if (useSteamVRFade && VRModule.activeModule == VRModuleActiveEnum.SteamVR && !Mathf.Approximately(delay, 0f))
281280
{
282281
if (!m_steamVRFadeInitialized)
283282
{

0 commit comments

Comments
 (0)