public void OnGUI(Rect rect, int value, DragSliderValueUpdateCallback valueUpdateCallback) { float centerX = rect.x + rect.width / 2; float y = rect.y + rect.height / 2; float height = rect.height; Rect slRect = new Rect(rect); if (DragSliderManager.DragSlider(slRect, 1, dragStartCallback, dragUpdateCallback, dragCompletedCallback)) { Reset(); this.value = value; dragBaseAmount = value; dragLimitWarningGiven = false; this.valueUpdateCallback = valueUpdateCallback; } string label = value.ToString(); GUI.color = Color.white; Text.Anchor = TextAnchor.MiddleCenter; rect.y += 2; Widgets.Label(rect, label); rect.y -= 2; Text.Anchor = TextAnchor.UpperLeft; GUI.color = Color.white; }
public void DraggingCompleted(float mouseOffX, float rateFactor) { SoundStarter.PlayOneShotOnCamera(DragEndSound); valueUpdateCallback = null; }
public void DraggingCompleted(float mouseOffX, float rateFactor) { SoundStarter.PlayOneShot(DragEndSound, SoundInfo.OnCamera(MaintenanceType.None)); valueUpdateCallback = null; }