//------------------------------------------------- void Update() { // Only update one per frame if (lastFrameUpdated == Time.renderedFrameCount) { return; } lastFrameUpdated = Time.renderedFrameCount; // SpawnRenderModel overflow if (spawnRenderModelUpdateIndex >= spawnRenderModels.Count) { spawnRenderModelUpdateIndex = 0; } // Perform update if (spawnRenderModelUpdateIndex < spawnRenderModels.Count) { SteamVR_RenderModel renderModel = spawnRenderModels[spawnRenderModelUpdateIndex].renderModels[0]; if (renderModel != null) { renderModel.UpdateComponents(OpenVR.RenderModels); } } spawnRenderModelUpdateIndex++; }
private void Update() { if (SpawnRenderModel.lastFrameUpdated == Time.renderedFrameCount) { return; } SpawnRenderModel.lastFrameUpdated = Time.renderedFrameCount; if (SpawnRenderModel.spawnRenderModelUpdateIndex >= SpawnRenderModel.spawnRenderModels.Count) { SpawnRenderModel.spawnRenderModelUpdateIndex = 0; } if (SpawnRenderModel.spawnRenderModelUpdateIndex < SpawnRenderModel.spawnRenderModels.Count) { SteamVR_RenderModel steamVR_RenderModel = SpawnRenderModel.spawnRenderModels[SpawnRenderModel.spawnRenderModelUpdateIndex].renderModels[0]; if (steamVR_RenderModel != null) { steamVR_RenderModel.UpdateComponents(OpenVR.RenderModels); } } SpawnRenderModel.spawnRenderModelUpdateIndex++; }