public void OnGUI() { if (!showVisualizer) { return; } if (!skeletonManager.skeletons[bodyTrackingDeviceID, playerId].isTracking || !gestureRecognizer) { return; } float gestureProgress = gestureRecognizer.GetGestureProgress(); if (gestureProgress >= visualizerThreshold) { float visualizerPhase = (gestureProgress - visualizerThreshold) / (1 - visualizerThreshold); int selectionVisualizerIndex = (int)(amountOfSelectionVisualizerImages * visualizerPhase); selectionVisualizerIndex = Mathf.Clamp(selectionVisualizerIndex, 0, amountOfSelectionVisualizerImages - 1); List <RUISDisplayManager.ScreenPoint> screenPoints = displayManager.WorldPointToScreenPoints(transform.position); foreach (RUISDisplayManager.ScreenPoint screenPoint in screenPoints) { RUISGUI.DrawTextureViewportSafe(new Rect(screenPoint.coordinates.x - visualizerWidth / 2, screenPoint.coordinates.y - visualizerHeight / 2, visualizerWidth, visualizerHeight), screenPoint.camera, selectionVisualizers[selectionVisualizerIndex]); //GUI.DrawTexture(new Rect(screenPoint.x - visualizerWidth / 2, screenPoint.y - visualizerHeight / 2, visualizerWidth, visualizerHeight), selectionVisualizers[selectionVisualizerIndex]); } } }