MouseOverGUI() public static méthode

Solve the flash problem! (JCS_CheckableObject) Check if the mouse still on top of the image! ATTENTIOIN(jenchieh): this will not work on the resizable window.
public static MouseOverGUI ( RectTransform imageRect, RectTransform rootPanel = null ) : bool
imageRect RectTransform
rootPanel RectTransform
Résultat bool
        /// <summary>
        /// Check the mouse if over the panel.
        /// </summary>
        /// <param name="rootPanel"> if there are root child plz use this to get the correct calculation </param>
        /// <returns> true: is over, false: not over </returns>
        public bool IsOnThere(RectTransform rootPanel)
        {
            if (GetObjectType() == JCS_UnityObjectType.UI)
            {
                if (JCS_Util.MouseOverGUI(this.mRectTransform, rootPanel))
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #2
0
        private void Update()
        {
            // IMPORTANT(JenChieh): only double click need update
            if (mIsOver)
            {
                if (JCS_Input.OnMouseDoubleClick(0))
                {
                    // either time is out or double click,
                    // both are all over the "double click event".
                    mIsOver = false;

                    if (mJCSButton != null)
                    {
                        if (!mJCSButton.Interactable)
                        {
                            // play not ineractable sound
                            mSoundPlayer.PlayOneShotByMethod(
                                mOnMouseDoubleClickRefuseSound,
                                mOnMouseDoubleClickRefuseSoundMethod);
                            return;
                        }
                        else
                        {
                            // play normal double click sound
                            mSoundPlayer.PlayOneShotByMethod(
                                mOnMouseDoubleClickSound,
                                mOnMouseDoubleClickSoundMethod);
                        }
                    }
                }

                // check if the mouse still over or not
                if (!JCS_Util.MouseOverGUI(this.mRectTransform))
                {
                    mIsOver = false;
                }
            }
        }