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); }
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; } } }