void SetStartValues() { RectTransform selectedTransform = tweenScript.rectTransform; if (tweenScript.animationParts.PositionPropetiesAnim.IsPositionEnabled()) { selectedTransform.anchoredPosition = (Vector2)tweenScript.animationParts.PositionPropetiesAnim.StartPos; } if (tweenScript.animationParts.ScalePropetiesAnim.IsScaleEnabled()) { selectedTransform.localScale = tweenScript.animationParts.ScalePropetiesAnim.StartScale; } if (tweenScript.animationParts.RotationPropetiesAnim.IsRotationEnabled()) { selectedTransform.localEulerAngles = tweenScript.animationParts.RotationPropetiesAnim.StartRot; } if (tweenScript.animationParts.FadePropetiesAnim.IsFadeEnabled()) { if (tweenScript.IsObjectOpened()) { SetAlphaValue(selectedTransform.transform, tweenScript.animationParts.FadePropetiesAnim.GetEndFadeValue()); } else { SetAlphaValue(selectedTransform.transform, tweenScript.animationParts.FadePropetiesAnim.GetStartFadeValue()); } } }
public void showSnippetDetails() { if (!snippetDetailsPanel.IsObjectOpened()) { dimmerPanel.OpenCloseObjectAnimation(); snippetDetailsPanel.OpenCloseObjectAnimation(); } }
public void ShowExplication(Explanation explanation) { if (!dialogAnimationTween.IsObjectOpened()) { dialogAnimationTween.OpenCloseObjectAnimation(); } content.text = explanation.text; }
public void OnDrag(PointerEventData eventData) { if (!canDrag) { return; } dragged = false; if (!tween.IsObjectOpened()) { transform.position = dragPosition + (Vector3)eventData.position; dragged = true; } }
IEnumerator coGetWalletURL() { UnityWebRequest www = new UnityWebRequest(UnityDevURL); www.downloadHandler = new DownloadHandlerBuffer(); yield return(www.SendWebRequest()); bool err = false; if (www.isNetworkError || www.isHttpError) { Debug.Log(www.error); err = true; } else { MG.WalletURL = www.downloadHandler.text; Debug.Log(MG.WalletURL); } yield return(new WaitUntil(() => txPoint.IsObjectOpened())); if (err) { pan_internetErr.SetActive(true); } else { yield return(new WaitForSeconds(2f)); introPan.OpenCloseObjectAnimation(); } }
/// <summary> /// 显示提示 /// </summary> /// <param name="duration">持续时间</param> /// <param name="content">显示内容</param> public void ShowToast(string content, float duration = 3f) { this.duration = duration; toastText.text = content; Timer.Start(); gameObject.SetActive(true); if (!easyTween.IsObjectOpened()) { easyTween.OpenCloseObjectAnimation(); } Debug.Log(content); }
public void onClick_Accumulate() { if (!viewPan.IsObjectOpened()) { viewPan.OpenCloseObjectAnimation(); } for (int i = 0; i < hidePan.Length; i++) { if (hidePan[i].IsObjectOpened()) { hidePan[i].OpenCloseObjectAnimation(); } } }
public void onClick_Payment() { if (!viewPan.IsObjectOpened()) { viewPan.OpenCloseObjectAnimation(); } for (int i = 0; i < hidePan.Length; i++) { if (hidePan[i].IsObjectOpened()) { hidePan[i].OpenCloseObjectAnimation(); } } send_Amount = 0m; }
void MoveToMouseClick(AnimationCurve animationCurve) { Vector3 mouseAnchor = Camera.main.ScreenToViewportPoint(Input.mousePosition); mouseAnchor = new Vector3(mouseAnchor.x * Screen.width / RootCanvas.localScale.x, mouseAnchor.y * Screen.height / RootCanvas.localScale.y, 0f); if (!TweenToControl.IsObjectOpened()) { TweenToControl.SetAnimationPosition(TweenToControl.rectTransform.anchoredPosition, (Vector2)mouseAnchor, animationCurve, animationCurve); } else { TweenToControl.SetAnimationPosition((Vector2)mouseAnchor, TweenToControl.rectTransform.anchoredPosition, animationCurve, animationCurve); } TweenToControl.OpenCloseObjectAnimation(); }