private void Btn_SureSearch(bool isShowNullTip) // 点击 确定搜索 { // 提示输入少于 2 位数 string kName = mInputField.text; if (string.IsNullOrEmpty(kName) || kName.Length <= 1) { if (isShowNullTip) { anim_ErrorTip.gameObject.SetActive(true); anim_ErrorTip.DORestart(); } return; } // 当前的字符等于之前的字符 if (kName == mCurrentInputStr) { return; } mCurrentInputStr = kName; // 提示找不到(TODO 暂停只找序列图) if (mDropdown.value > 0) { anim_SearchNull.gameObject.SetActive(true); anim_SearchNull.DORestart(); return; } SearchAndShow(kName, true); // 搜索 And 显示 }
private void SetWarnText(IMessage rMessage) { if ((int)rMessage.Data == 0) { WarnSub.DORestart(); } }
public void PlayShowAnim() { if (showAnim != null) { showAnim.DORestart(); } }
private void Btn_SureSearch(bool isShowNullTip) // 点击 确定搜索 { // 提示输入少于 2 位数 string kName = mInputField.text; int min = isShowNullTip ? 1 : 2; if (string.IsNullOrEmpty(kName) || kName.Length < min) { if (isShowNullTip) { anim_ErrorTip.gameObject.SetActive(true); anim_ErrorTip.DORestart(); } return; } // 当前的字符等于之前的字符 if (kName == mCurrentInputStr) { return; } mCurrentInputStr = kName; SearchAndShow(kName, true); // 搜索 And 显示 }
private void TimerModelOnIsStartedChanged(bool isStarted) { if (!isStarted) { _doTweenAnimation.DORestart(); } }
private void ButtonOnClick() { if (_doTweenAnimation == null) { return; } _doTweenAnimation.DORestart(); }
public void UsingRadar() { ResetRadar(); GetComponent <AudioSource> ().Play(); DOTween.To(() => radarCollider.radius, x => radarCollider.radius = x, maxRadius, speed); Instantiate(radarFx, transform.position, transform.rotation); radarUIAnim.DORestart(); radarUIAnim.DOPlay(); //radarSprite.transform.DOScale (new Vector3 (maxRadius, maxRadius), speed); }
public void OnClickSave() { DOTweenAnimation timeInAnim = timeInField.GetComponent <DOTweenAnimation>(), timeOutAnim = timeOutField.GetComponent <DOTweenAnimation>(); bool hasError = false; TimeSpan testIn, testOut; if (!TimeSpan.TryParseExact( // wrong format error (e.g. 2561, 9999...) newTimeIn, "hhmm", null, System.Globalization.TimeSpanStyles.None, out testIn) || // different format from DateTime currentDay.hours.rawTimeIn != newTimeIn && testIn > testOut || newTimeIn == "") { timeInAnim?.DORestart(); hasError = true; } if (!TimeSpan.TryParseExact( // wrong format error (e.g. 2561, 9999...) newTimeOut, "hhmm", null, System.Globalization.TimeSpanStyles.None, out testOut) || // different format from DateTime currentDay.hours.rawTimeOut != newTimeOut && testOut < testIn || newTimeOut == "") { timeOutAnim?.DORestart(); hasError = true; } if (hasError) { return; } currentDay.hours.rawTimeIn = newTimeIn; currentDay.hours.rawTimeOut = newTimeOut; currentDay.hours.time_in = currentDay.hours.date + testIn; currentDay.hours.time_out = currentDay.hours.date + testOut; currentDay.CalculateHours(); FlexStatus.Instance.CalculateFlexHours(); using (SqliteCommand command = new SqliteCommand(Database.DB)) { command.CommandText = string.Format( "UPDATE hours SET time_in = \"{2}\", time_out = \"{3}\" WHERE username = \"{0}\" AND date = \"{1}\";" + "INSERT INTO hours (username, date, time_in, time_out) SELECT \"{0}\", \"{1}\", \"{2}\", \"{3}\" WHERE (SELECT changes() = 0);", //"INSERT OR REPLACE INTO hours (username, date, time_in, time_out) VALUES (\"{0}\", \"{1}\", \"{2}\", \"{3}\")", User.username, currentDay.hours.date.ToString("yyyy-MM-dd"), newTimeIn, newTimeOut); command.ExecuteNonQuery(); } foreach (var anim in totalHours.GetComponents <DOTweenAnimation>()) { anim.DORestart(); } }
/// <summary> /// Plays the tween to show the Remove button. /// </summary> /// <param name="isOn">Is the button being toggled on?</param> public void ToggleRemoveButton(bool isOn) { if (isOn) { removeTween.DORestart(); } else { removeTween.DOPlayBackwards(); } }
/// <summary> /// 播放抖动动画 /// </summary> public void PalyJoggleDOTweenAnimation() { if (!_isPalyJoggleDOTweenAnimation) { transform.localEulerAngles = Vector3.zero; _joggleDOTweenAnimation.enabled = false; return; } _joggleDOTweenAnimation.enabled = true; _joggleDOTweenAnimation.DORestart(); Invoke("PalyJoggleDOTweenAnimation", 2f); }
/// <summary> /// 打开结算界面以及动画 /// </summary> /// <param name="obj"></param> private void OnSeatSettle(TransferData data) { RoomEntity settleRoom = data.GetValue <RoomEntity>("Room"); bool isSpring = false; for (int i = 0; i < settleRoom.SeatCount; i++) { if (settleRoom.SeatList[i].isSpring) { isSpring = true; break; } } float waitTime = 1; if (isSpring) { waitTime += 2f; if (springAnimation != null) { springAnimation.gameObject.SetActive(true); springAnimation.transform.GetComponent <UIItemSpringAnimation>().FlowerAnimation(); springAnimation.DORestart(); } //Action OpenSettleView = (() => //{ // m_UISettleView = UIViewUtil.Instance.LoadWindow("Settle_DouDiZhu").GetComponent<UISettleView>(); // m_UISettleView.SetUI(settleRoom/*,UISceneDouDZView.Instance.GetTxtLoop()*/); //}); //GetOrCreatUIItemAnimation().ShowPokersAnimation("DouDiZhu/UI_Spring_DouDiZhu", m_AnimationContainer.position, m_AnimationContainer.position, AnimationType.Spring, 1.5f, DG.Tweening.Ease.Linear,OpenSettleView); } //m_UISettleView = UIViewUtil.Instance.LoadWindow("Settle_DouDiZhu").GetComponent<UISettleView>(); //m_UISettleView.SetUI(settleRoom/*,UISceneDouDZView.Instance.GetTxtLoop()*/); //m_UISettleView.SafeSetActive(false); //StartCoroutine(openSettelView(waitTime)); }
/// <summary> /// 展示奖品 /// </summary> /// <param name="goodsDatas"></param> /// <param name="treasureChestID">宝箱配置id</param> public void ShowPrize(List <CSWareHouseStruct> goodsDatas, int treasureChestID, Action endAction) { if (!_isInitial) { Initial(); } ResetTreasureChest(); _endAction = endAction; _prizes.AddRange(goodsDatas); SetTreasureChestShow(treasureChestID); _treasureChestBoxTraDOTween.DORestart(); }
public void Init() { UpdateTxtLevel(); tweenBoxTop.DOPlayBackwards(); tweenBtnSetting.DORestart(); tweenBtnShop.DORestart(); tweenBtnRemoveAd.DORestart(); rectTxtTapToPlay.localScale = Vector2.one; rectTxtTapToPlay.gameObject.SetActive(true); groupTxtTapToPlay.DOPlayBackwards(); groupTxtTapToPlay.alpha = 1; rectTxtNameGame.anchoredPosition = posOriginTxtName; bgClick.gameObject.SetActive(true); }
static public IObservable <DOTweenAnimation> DORestartAsObservable( this DOTweenAnimation animation, bool fromHere = false) { return(Observable.Create <DOTweenAnimation>(o => { animation.tween.OnComplete(() => { o.OnNext(animation); o.OnCompleted(); }); animation.DORestart(fromHere); return Disposable.Empty; })); }
/// <summary> /// 宝箱移动完毕 /// </summary> async void MoverEnd() { CanvasGroup boxCanvasGroup = _lightingEffectRect.GetComponent <CanvasGroup>(); await ChapterTool.FadeInFadeOut(boxCanvasGroup, 1, 10, null, () => { _shakeDOTween.DORestart(); if (_currHuDieController == null) { _currHuDieController = Instantiate(_huDieController); } ChapterTool.FadeInFadeOut(_theButterflyEffectBox, 1, 10); _isTwinkle = true; Twinkle(); }); }
protected override void OnBtnClick(GameObject go) { base.OnBtnClick(go); switch (go.name) { case ConstDefine.BtnSetting: UIViewManager.Instance.OpenWindow(UIWindowType.Setting); break; case ConstDefine.BtnMaJiangViewAuto: SendNotification(ConstDefine.BtnMaJiangViewAuto); break; case ConstDefine.BtnGameViewChat: UIViewManager.Instance.OpenWindow(UIWindowType.Chat); break; case ConstDefine.BtnMaJiangViewCancelAuto: SendNotification(ConstDefine.BtnMaJiangViewCancelAuto); break; case ConstDefine.BtnGameViewShare: SendNotification(ConstDefine.BtnGameViewShare); break; case ConstDefine.BtnMaJiangViewReady: SendNotification(ConstDefine.BtnMaJiangViewReady); break; case ConstDefine.BtnMaJiangViewCancelReady: SendNotification(ConstDefine.BtnMaJiangViewCancelReady); break; case "btnMaJiangViewRule": UIItemMahJongRoomInfo.Instance.ChangeRuleActive(); break; case "btnMahjongViewRoomInfo": m_btnRoomInfoClose.gameObject.SetActive(true); m_RoomInfo.DORestart(); break; case "btnMahjongViewRoomInfoClose": m_btnRoomInfoClose.gameObject.SetActive(false); m_RoomInfo.DOPlayBackwards(); break; } }
private void MoveProcess(MoveDirection direction) { if (direction == MoveDirection.None) { return; } if (direction == MoveDirection.Right) { Value += _increment; _rightArrowAnimation.DORestart(); } else if (direction == MoveDirection.Left) { Value -= _increment; _leftArrowAnimation.DORestart(); } if (Value < _min) { if (!_loopAround) { Value = _min; } else { Value = _max - _min + Value + 1; } } else if (Value > _max) { if (!_loopAround) { Value = _max; } else { Value = _min - _max + Value - 1; } } UpdateSlider(); // This function is Only called if the value has changed, thats why this is here. OnValueChange?.Invoke(Value); }
private void Update() { int time = GameVO.Instance.hasBuyMusic.value ? 500 : 1000; if (fadeOutFlag && System.DateTime.Now.Subtract(fadeOutTime).TotalMilliseconds > time) { fadeOutFlag = false; FadeOut2(); } shopEffectGap--; if (shopEffectGap == 0) { coinAnimation.DORestart(); shopEffectGap = 30 * 60; } }
public void ComboHit(int comboHit) { if (null == mCombo) { return; } if (!mCombo.activeSelf) { mCombo.SetActive(true); } mComboCount += comboHit; mCountLab.text = mComboCount.ToString(); mTweenAlpha.Restart(); mTweenScale.DORestart(); }
protected override void CustomPlayFeedback(Vector3 position, float feedbacksIntensity = 1.0f) { switch (Mode) { case Modes.DOPlay: TargetDOTweenAnimation.DOPlay(); break; case Modes.DOPlayBackwards: TargetDOTweenAnimation.DOPlayBackwards(); break; case Modes.DOPlayForward: TargetDOTweenAnimation.DOPlayForward(); break; case Modes.DOPause: TargetDOTweenAnimation.DOPause(); break; case Modes.DOTogglePause: TargetDOTweenAnimation.DOTogglePause(); break; case Modes.DORewind: TargetDOTweenAnimation.DORewind(); break; case Modes.DORestart: TargetDOTweenAnimation.DORestart(); break; case Modes.DOComplete: TargetDOTweenAnimation.DOComplete(); break; case Modes.DOKill: TargetDOTweenAnimation.DOKill(); break; } }
IEnumerator ImgTweenOver() { yield return(new WaitForSeconds(0.5f)); IsTween = false; ed.enabled = false; yield return(new WaitForSeconds(1)); if (!isScan) { scanImg.DORestart(true); IsTween = true; yield return(new WaitForSeconds(1.5f)); ed.enabled = true; } else { StartCoroutine(ImgTweenOver()); } }
public void UnLockById(GoodsType goods, bool endLock, bool playDT) { DOTweenAnimation doTween = null; switch (goods) { case GoodsType.DIAMOND: { m_idEndLock[goods] = endLock; doTween = DiamondNode.gameObject.GetComponent <DOTweenAnimation>(); DiamondChanged(PlayerDataMgr.singleton.Diamond); } break; case GoodsType.GOLD: { m_idEndLock[goods] = endLock; doTween = GoldNode.gameObject.GetComponent <DOTweenAnimation>(); GoldChanged(PlayerDataMgr.singleton.Gold); } break; case GoodsType.CAMPSITE_REWARD: { m_idEndLock[goods] = endLock; doTween = CampRewardNode.gameObject.GetComponent <DOTweenAnimation>(); if (endLock) { CampRewardChanged(CampsiteMgr.singleton.TotalRewardVal); } } break; } if (doTween != null && playDT) { doTween.DORestart(); } }
public void Show() { tween.DORestart(); }
public void ResetShock() { Shockanimation.DORestart(); Shockanimation.DOPause(); }
/// <summary> /// 大转盘 /// </summary> private void LotteryWheel() { if (choiceTotalCircle >= totalCircle && choiceNum == choiceTargetNum) { oncetimer = 0; choiceTotalCircle = 0; DeleteShadowEffect(); m_UIWelfareActivitiesWindow.OnLotteryWheelComplete(); isStartTurn = false; onceChoiceTimer = 0.1f; Debug.LogWarning(choiceTargetNum - 1); int rotateAnimationIndex; if ((choiceTargetNum - 1) == -1) { rotateAnimationIndex = 11; //rotateAnimation.transform.SetParent(giftRawImage[11].transform); } else { rotateAnimationIndex = choiceTargetNum - 1; //rotateAnimation.transform.SetParent(giftRawImage[choiceTargetNum - 1].transform); } rotateAnimation.transform.SetParent(giftRawImage[rotateAnimationIndex].transform); rotateAnimation.transform.SetAsLastSibling(); rotateAnimation.transform.localPosition = Vector2.zero; rotateAnimation.SafeSetActive(true); moveAnimation.transform.position = giftRawImage[rotateAnimationIndex].transform.position; UIGiftInfo uiGiftInfo = giftRawImage[rotateAnimationIndex].transform.GetComponent <UIGiftInfo>(); if (uiGiftInfo.GetUIGiftType() == GiftType.Null) { AudioEffectManager.Instance.Play("notGetPrize"); } else { AudioEffectManager.Instance.Play("getPrize"); } TextureManager.Instance.LoadHead(uiGiftInfo.GetURL(), (Texture2D texture2d) => { moveAnimation.transform.GetComponent <RawImage>().texture = texture2d; giftImage.texture = texture2d; }, true); rotateAnimation.DORestart(); giftShaddingImage.SafeSetActive(true); giftShaddingImage.color = Color.clear; } else { AddShadowEffect(); if (choiceTotalCircle < reduceAndAddCircle) { if (onceChoiceTimer > onceMaxChoiceTimer) { onceChoiceTimer = Mathf.Lerp(onceChoiceTimer, onceMaxChoiceTimer, 1 * Time.deltaTime); } } else if (choiceTotalCircle > totalCircle - reduceAndAddCircle) { if (onceChoiceTimer < onceMinChoiceTimer) { onceChoiceTimer = Mathf.Lerp(onceChoiceTimer, onceMinChoiceTimer, 0.5f * Time.deltaTime); } } if (oncetimer > onceChoiceTimer) { AudioEffectManager.Instance.Play("dudu"); choiceNum++; choiceNum %= giftRawImage.Length; oncetimer = 0; if (choiceNum == choiceTargetNum) { choiceTotalCircle++; } } } oncetimer += Time.deltaTime; }
private void OnMouseDown() { _pressAnim.DORestart(); Pressed?.Invoke(_number); }
private void PlayAnimation() { _animation.duration = Random.Range(_minimumTime, _maximumTime); _animation.DORestart(); }
// TODO: add knockback if necessary public void Hit(int damage, Transform attacker) { _tween.DORestart(); }
private void ShakeBar() { _shakeAnimation?.DORestart(); }