Open dpggit opened 4 years ago
Did you upgrade this script when you updated the steamvr plugin version? What version of the steamvr runtime are you seeing this on?
```
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Helper for smoothing over transitions between levels.
//
//=============================================================================
using UnityEngine;
using System.Collections;
using Valve.VR;
using System.IO;
namespace Valve.VR
{
public class SteamVR_LoadLevel : MonoBehaviour
{
private static SteamVR_LoadLevel _active = null;
public static bool loading { get { return _active != null; } }
public static float progress
{
get { return (_active != null && _active.async != null) ? _active.async.progress : 0.0f; }
}
public static Texture progressTexture
{
get { return (_active != null) ? _active.renderTexture : null; }
}
// Name of level to load.
public string levelName;
// Name of internal process to launch (instead of levelName).
public string internalProcessPath;
// The command-line args for the internal process to launch.
public string internalProcessArgs;
// If true, call LoadLevelAdditiveAsync instead of LoadLevelAsync.
public bool loadAdditive;
// Async load causes crashes in some apps.
public bool loadAsync = true;
// Optional logo texture.
public Texture loadingScreen;
// Optional progress bar textures.
public Texture progressBarEmpty, progressBarFull;
// Sizes of overlays.
public float loadingScreenWidthInMeters = 6.0f;
public float progressBarWidthInMeters = 3.0f;
// If specified, the loading screen will be positioned in the player's view this far away.
public float loadingScreenDistance = 0.0f;
// Optional overrides for where to display loading screen and progress bar overlays.
// Otherwise defaults to using this object's transform.
public Transform loadingScreenTransform, progressBarTransform;
// Optional skybox override textures.
public Texture front, back, left, right, top, bottom;
// Colors to use when dropping to the compositor between levels if no skybox is set.
public Color backgroundColor = Color.black;
// If false, the background color above gets applied as the foreground color in the compositor.
// This does not have any effect when using a skybox instead.
public bool showGrid = false;
// Time to fade from current scene to the compositor and back.
public float fadeOutTime = 0.5f;
public float fadeInTime = 0.5f;
// Additional time to wait after finished loading before we start fading the new scene back in.
// This is to cover up any initial hitching that takes place right at the start of levels.
// Most scenes should hopefully not require this.
public float postLoadSettleTime = 0.0f;
// Time to fade loading screen in and out (also used for progress bar).
public float loadingScreenFadeInTime = 1.0f;
public float loadingScreenFadeOutTime = 0.25f;
float fadeRate = 1.0f;
float alpha = 0.0f;
AsyncOperation async; // used to track level load progress
RenderTexture renderTexture; // used to render progress bar
ulong loadingScreenOverlayHandle = OpenVR.k_ulOverlayHandleInvalid;
ulong progressBarOverlayHandle = OpenVR.k_ulOverlayHandleInvalid;
public bool autoTriggerOnEnable = false;
void OnEnable()
{
if (autoTriggerOnEnable)
Trigger();
}
public void Trigger()
{
if (!loading && !string.IsNullOrEmpty(levelName))
StartCoroutine(LoadLevel());
}
// Helper function to quickly and simply load a level from script.
public static void Begin(string levelName,
bool showGrid = false, float fadeOutTime = 0.5f,
float r = 0.0f, float g = 0.0f, float b = 0.0f, float a = 1.0f)
{
var loader = new GameObject("loader").AddComponent
I use steamvr 2.5 and its just the 2.5 script
I had SteamVR_LoadLevel working but at some point stopped working, i recently updated to Unity 2019.2 and also to Steamvr 2.5. I didnt modify the script, but now loading message doesnt appear anymore. I just have loadingscreen and loadingbar inside the Canvas. Scene is loaded but the loading messages dont appear anymore