void OnGUI() { // controller counter GUI.Label(new Rect(10, 500, 500, 200), "Controllers connected: " + ControllerPlayers.Count); if (RumblingRightNow || ReadyToGetInput) { string text = string.Format("Rumbling now ... {0}", CurrentRumble.ToString()); if (ReadyToGetInput) { string readyText = string.Format("\nREADY FOR INPUT: {0}", inputCounter); text += readyText; } GUI.Label(new Rect(Screen.width / 2, Screen.height / 2, 500, 500), text); return; } // use help paper usingHelpPaper = GUI.Toggle(new Rect(800, 300, 200, 30), usingHelpPaper, "Using help paper"); // choose pattern time interval RumbleInterval = GUI.HorizontalSlider(new Rect(800, 400, 100, 30), RumbleInterval, 0.1f, 5f); GUI.Label(new Rect(910, 400, 100, 30), RumbleInterval.ToString()); GUI.Label(new Rect(800, 380, 300, 30), "Time interval (only for *):"); // choose pattern message (A, B, X, Y) pattern = GUI.SelectionGrid(new Rect(800, 0, 300, 200), pattern, patternString, 1); GUILayout.BeginArea(new Rect(0, 0, 700, 700)); // choose pattern type if (GUILayout.Button("Static Intensity rumble*")) { CurrentRumble = new StaticIntensity(ControllerPlayers, this); if (CurrentRumble != null) CurrentRumble.StartRumble(pattern); } if (GUILayout.Button("Varying Intensity rumble*")) // Benjamin { CurrentRumble = new ControllerTesterRumbleVaryingIntensity(ControllerPlayers, this); if (CurrentRumble != null) CurrentRumble.StartRumble(pattern); } if (GUILayout.Button("Right/left rumble*")) { CurrentRumble = new RightLeft(ControllerPlayers, this); if (CurrentRumble != null) CurrentRumble.StartRumble(pattern); } if (GUILayout.Button("Morsecode rumble")) { CurrentRumble = new MorseCode(ControllerPlayers, this); if (CurrentRumble != null) CurrentRumble.StartRumble(pattern); } if (GUILayout.Button("Interval rumble")) { CurrentRumble = new Interval(ControllerPlayers, this); if (CurrentRumble != null) CurrentRumble.StartRumble(pattern); } GUILayout.EndArea(); }
public void RemoveRumble() { CurrentRumble = null; }
public void RemoveRumble() { CurrentRumble = null; }
void OnGUI() { // controller counter GUI.Label(new Rect(10, 500, 500, 200), "Controllers connected: " + ControllerPlayers.Count); if (RumblingRightNow || ReadyToGetInput) { string text = string.Format("Rumbling now ... {0}", CurrentRumble.ToString()); if (ReadyToGetInput) { string readyText = string.Format("\nREADY FOR INPUT: {0}", inputCounter); text += readyText; } GUI.Label(new Rect(Screen.width / 2, Screen.height / 2, 500, 500), text); return; } // use help paper usingHelpPaper = GUI.Toggle(new Rect(800, 300, 200, 30), usingHelpPaper, "Using help paper"); // choose pattern time interval RumbleInterval = GUI.HorizontalSlider(new Rect(800, 400, 100, 30), RumbleInterval, 0.1f, 5f); GUI.Label(new Rect(910, 400, 100, 30), RumbleInterval.ToString()); GUI.Label(new Rect(800, 380, 300, 30), "Time interval (only for *):"); // choose pattern message (A, B, X, Y) pattern = GUI.SelectionGrid(new Rect(800, 0, 300, 200), pattern, patternString, 1); GUILayout.BeginArea(new Rect(0, 0, 700, 700)); // choose pattern type if (GUILayout.Button("Static Intensity rumble*")) { CurrentRumble = new StaticIntensity(ControllerPlayers, this); if (CurrentRumble != null) { CurrentRumble.StartRumble(pattern); } } if (GUILayout.Button("Varying Intensity rumble*")) // Benjamin { CurrentRumble = new ControllerTesterRumbleVaryingIntensity(ControllerPlayers, this); if (CurrentRumble != null) { CurrentRumble.StartRumble(pattern); } } if (GUILayout.Button("Right/left rumble*")) { CurrentRumble = new RightLeft(ControllerPlayers, this); if (CurrentRumble != null) { CurrentRumble.StartRumble(pattern); } } if (GUILayout.Button("Morsecode rumble")) { CurrentRumble = new MorseCode(ControllerPlayers, this); if (CurrentRumble != null) { CurrentRumble.StartRumble(pattern); } } if (GUILayout.Button("Interval rumble")) { CurrentRumble = new Interval(ControllerPlayers, this); if (CurrentRumble != null) { CurrentRumble.StartRumble(pattern); } } GUILayout.EndArea(); }