/// <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_Utility.MouseOverGUI(this.mRectTransform, rootPanel)) { return(true); } } return(false); }
/// <summary> /// Use for inspector. (Deactive) /// </summary> /// <returns></returns> public bool JCS_OnMouseExit() { if (!mIsActive) { return(false); } if (GetObjectType() == JCS_UnityObjectType.UI) { if (JCS_Utility.MouseOverGUI(this.mRectTransform)) { return(false); } } Deactive(); return(true); }
public void JCS_OnMouseExit() { if (!mEffect) { return; } if (GetObjectType() == JCS_UnityObjectType.UI) { UpdateUnityData(); if (JCS_Utility.MouseOverGUI(this.mRectTransform)) { return; } } mEffect = false; mTargetScale = mRecordScale; }
public void JCS_HideDescDialogue() { if (mDescDialogue == null) { JCS_Debug.LogError("JCS_CheckableObject", "No dialogue object attached..."); return; } #if (UNITY_STANDALONE || UNITY_EDITOR) // is is still on top of the image, return it if (JCS_Utility.MouseOverGUI(mRectTransform, mRootPanel)) { return; } #endif mDescDialogue.HideDialogueWithoutSound(); mShowing = 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_Utility.MouseOverGUI(this.mRectTransform)) { mIsOver = false; } } }