Exemplo n.º 1
0
        /// <summary>
        /// Clears the underlay GUI element (for example ping, hover, select).
        /// </summary>
        private void ClearUnderlay()
        {
            if (underlay != null)
            {
                underlay.Destroy();
                underlay = null;
            }

            underlayState = UnderlayState.None;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Changes the visual representation of the element as being pinged.
        /// </summary>
        /// <param name="enable">True if mark as pinged, false to reset to normal.</param>
        public void MarkAsPinged(bool enable)
        {
            if ((int)underlayState > (int)UnderlayState.Pinged)
            {
                return;
            }

            if (enable)
            {
                CreateUnderlay();
                underlay.SetTint(PING_COLOR);
                underlayState = UnderlayState.Pinged;
            }
            else
            {
                ClearUnderlay();
                underlayState = UnderlayState.None;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Changes the visual representation of the element as being hovered over.
        /// </summary>
        /// <param name="enable">True if mark as hovered, false to reset to normal.</param>
        public void MarkAsHovered(bool enable)
        {
            if ((int)underlayState > (int)UnderlayState.Hovered)
            {
                return;
            }

            if (enable)
            {
                CreateUnderlay();
                underlay.SetTint(HOVER_COLOR);
                underlayState = UnderlayState.Hovered;
            }
            else
            {
                ClearUnderlay();
                underlayState = UnderlayState.None;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Changes the visual representation of the element as being selected.
        /// </summary>
        /// <param name="enable">True if mark as selected, false to reset to normal.</param>
        public void MarkAsSelected(bool enable)
        {
            if ((int)underlayState > (int)UnderlayState.Selected)
            {
                return;
            }

            if (enable)
            {
                CreateUnderlay();
                underlay.SetTint(SELECTION_COLOR);
                underlayState = UnderlayState.Selected;
            }
            else
            {
                ClearUnderlay();
                underlayState = UnderlayState.None;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Clears the underlay GUI element (for example ping, hover, select).
        /// </summary>
        private void ClearUnderlay()
        {
            if (underlay != null)
            {
                underlay.Destroy();
                underlay = null;
            }

            underlayState = UnderlayState.None;
        }
Exemplo n.º 6
0
        /// <summary>
        /// Changes the visual representation of the element as being selected.
        /// </summary>
        /// <param name="enable">True if mark as selected, false to reset to normal.</param>
        public void MarkAsSelected(bool enable)
        {
            if ((int)underlayState > (int)UnderlayState.Selected)
                return;

            if (enable)
            {
                CreateUnderlay();
                underlay.SetTint(SELECTION_COLOR);
                underlayState = UnderlayState.Selected;
            }
            else
            {
                ClearUnderlay();
                underlayState = UnderlayState.None;
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Changes the visual representation of the element as being pinged.
        /// </summary>
        /// <param name="enable">True if mark as pinged, false to reset to normal.</param>
        public void MarkAsPinged(bool enable)
        {
            if ((int)underlayState > (int)UnderlayState.Pinged)
                return;

            if (enable)
            {
                CreateUnderlay();
                underlay.SetTint(PING_COLOR);
                underlayState = UnderlayState.Pinged;
            }
            else
            {
                ClearUnderlay();
                underlayState = UnderlayState.None;
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// Changes the visual representation of the element as being hovered over.
        /// </summary>
        /// <param name="enable">True if mark as hovered, false to reset to normal.</param>
        public void MarkAsHovered(bool enable)
        {
            if ((int)underlayState > (int)UnderlayState.Hovered)
                return;

            if (enable)
            {
                CreateUnderlay();
                underlay.SetTint(HOVER_COLOR);
                underlayState = UnderlayState.Hovered;
            }
            else
            {
                ClearUnderlay();
                underlayState = UnderlayState.None;
            }
        }