Exemple #1
0
        IEnumerator InternalDelayedSetActive(bool value, float time)
        {
            yield return(new WaitForSeconds(time));

            SetActive(value);
            OnToggled?.Invoke(value);
        }
 private void CustomToggleSwitch_MouseDown(object sender, MouseEventArgs e)
 {
     if (Enabled)
     {
         Checked = !Checked;
         OnToggled.Invoke(sender, e);
         Invalidate();
     }
 }
    protected void OnToggleValueChanged(bool isOn)
    {
        // Debug.Log("OnToggleValueChanged: "+isOn);

        // if was toggle off by multiple click
        if (_wasSelected && !isOn || isOn)
        {
            OnToggled?.Invoke(this, isOn);
        }
        _wasSelected = isOn;
    }
Exemple #4
0
 public void SetActive(bool value)
 {
     gameObject.SetActive(value);
     OnToggled?.Invoke(value);
 }
Exemple #5
0
 public override void OnMouseClick(OnKeyEventArgs E)
 {
     Checked = !Checked;
     OnToggled?.Invoke(this, new OnCheckBoxToggledEventArgs(GUI, Checked));
 }
Exemple #6
0
 private void InternalOnToggled(IntPtr b, IntPtr data)
 {
     OnToggled?.Invoke(this);
 }
Exemple #7
0
        private void Sw_Toggled(object sender, ToggledEventArgs e)
        {
            var obj = (Switch)sender;

            OnToggled?.Invoke(sender, obj.IsToggled);
        }
 private void Awake()
 {
     toggle.onValueChanged.AddListener(x => OnToggled?.Invoke(Index, x));
 }