Exemplo n.º 1
0
 public void Destroy()
 {
     OnDestroy?.Invoke();
     OnToggle         = null;
     OnDestroy        = null;
     OnFontSizeChange = null;
     OnTextChange     = null;
     _created         = false;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Registers a new toggle button. It will be placed below all others
        /// that are currently registered.
        /// </summary>
        /// <param name="text">The text to display on the button</param>
        /// <param name="cb">Callback to call when the button is clicked</param>
        /// <param name="defaultValue">Starting state of the toggle</param>
        /// <param name="fontSize">Font size of the text on the button</param>
        public static void RegisterSettingsButton(string text, SettingsToggle cb,
                                                  bool defaultValue = false, int fontSize = 0)
        {
            var button = new SettingsButton()
            {
                text         = text,
                cb           = cb,
                defaultValue = defaultValue,
                fontSize     = fontSize
            };

            toAdd.Add(button);

            if (Game.AddPiece != null)
            {
                RegisterSettingsButtonInternal(button);
            }
        }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     blood = FindObjectOfType <SettingsToggle>();
 }
 public void SetCallback(SettingsToggle cb)
 {
     callback = cb;
 }
Exemplo n.º 5
0
 public void SetCallback(SettingsToggle cb)
 {
     callback = cb;
 }