12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using UnityEngine;
- using System.Collections;
- public class TweakCondomDispenserValues : MonoBehaviour {
- CondomDispenser condomDispenser;
- bool isTweaking;
- void Start()
- {
- condomDispenser = GetComponent<CondomDispenser>();
- DebugViewManager.OnDebugView += OnDebugView;
- }
- void OnDestroy()
- {
- DebugViewManager.OnDebugView -= OnDebugView;
- }
- static void ShowFloatSlider(string label, ref float output, float min, float max)
- {
- GUILayout.Label(label+" "+output);
- output = GUILayout.HorizontalSlider(output, min, max, null);
- }
- static void ShowIntSlider(string label, ref int output, int min, int max)
- {
- GUILayout.Label(label+" "+output);
- output = (int)GUILayout.HorizontalSlider(output, min, max, null);
- }
- void OnDebugView()
- {
- if (GUILayout.Button("Tweak"))
- {
- isTweaking = !isTweaking;
- }
- if (isTweaking)
- {
- ShowFloatSlider("Move Speed", ref condomDispenser.moveSpeed, 500, 10000);
- ShowFloatSlider("Recoil Offset", ref condomDispenser.recoilOffset, 0, 20);
- ShowFloatSlider("Recoil Time Out", ref condomDispenser.recoilTimeOut, 0, 0.5f);
- ShowFloatSlider("Recoil Time In", ref condomDispenser.recoilTimeIn, 0, 0.5f);
- ShowIntSlider("Max Queue (0 = infinite)", ref condomDispenser.maxQueuedTaps, 0, 10);
- }
- }
- }
|