public void Destroy() { OnDestroy?.Invoke(); OnToggle = null; OnDestroy = null; OnFontSizeChange = null; OnTextChange = null; _created = false; }
/// <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); } }
// Use this for initialization void Start() { blood = FindObjectOfType <SettingsToggle>(); }
public void SetCallback(SettingsToggle cb) { callback = cb; }