public override void OnSelected(ProvinceBean province, CityBean city, DistrictBean district)
 {
     OnSelectedEvent?.Invoke(this, new CityItemClickSelectedEventArgs()
     {
         Province = province,
         City     = city,
         District = district
     });
 }
Esempio n. 2
0
    /// <summary>
    /// Dispatch event when clickd on
    /// </summary>
    private void OnMouseOver()
    {
        if (IsRetracted)
        {
            return;
        }

        OnMouseOverEvent?.Invoke(this);

        if (Input.GetButtonDown("Select"))
        {
            OnSelectedEvent?.Invoke(this);
        }
    }
Esempio n. 3
0
        /// <summary>
        /// Adds added logic specific to RADIO and TOGGLE buttons to the Widjet update loop
        /// </summary>
        public override void Update()
        {
            base.Update();

            if ((buttonType == ButtonType.RADIO || buttonType == ButtonType.TOGGLE) && isSelected && !isDisabled)
            {
                if (!hasOnSelectedFired)
                {
                    hasOnSelectedFired = true;
                    OnSelectedEvent.Invoke(this, null);
                }

                if (isDefaultImage)
                {
                    buttonImage.Color = Color.Cyan;
                }
                else if (buttonSpriteMap != null)
                {
                    if (buttonSpriteMap != null)
                    {
                        buttonSpriteMap.Play("clicked");
                    }
                }
            }
            else if ((buttonType == ButtonType.RADIO || buttonType == ButtonType.TOGGLE) && !isSelected && !isDisabled)
            {
                if (hasOnSelectedFired)
                {
                    hasOnSelectedFired = false;
                    OnDeselectedEvent.Invoke(this, null);
                }

                if (!hasOnHoverFired)
                {
                    if (isDefaultImage)
                    {
                        buttonImage.Color = Color.White;
                    }
                    else if (buttonSpriteMap != null)
                    {
                        if (buttonSpriteMap != null)
                        {
                            buttonSpriteMap.Play("inactive");
                        }
                    }
                }
            }
        }