Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- //This will be a seperate class from MainMenuControl for ease of reading and to avoid any chance of spaghetti code
- public class OptionsMenu : MonoBehaviour
- {
- /// References to other objects in the scene
- public Slider hoverDelaySlider;
- public Slider effectDelaySlider;
- public Toggle showEffectsToggle;
- public Toggle holdToHoverToggle;
- public Toggle holdToDragToggle;
- /// References to class instances we will use in this script
- public Options optionsVaribles;
- public MainMenuControl mainMenuControl;
- public MenuControl menuControl;
- //Each slider/toggle has been seperated into its own function so we can use the editor's inbuilt on value changed wiget
- //This way we dont have to call it every frame
- public void setHoverDelay()
- {
- Options.HoverDelay = hoverDelaySlider.value;
- }
- public void setShowEffects()
- {
- Options.ShowEffectsOnHover = showEffectsToggle.isOn;
- }
- public void setEffectDisplayDelay()
- {
- Options.EffectDisplayDelay = effectDelaySlider.value;
- }
- public void setHoldToHover()
- {
- //Options.HoldToHover = holdToHoverToggle.isOn;
- }
- public void setHoldToDrag()
- {
- Options.HoldMouseButtonToDrag = holdToDragToggle.isOn;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement