/// <summary> /// 输入错误内容回调 /// </summary> private void OnInputWrong() { TextTool.RefreshText(_promptText, _wrongPromptStr); Tweener tweener = _promptText.DOFade(0, _promptFadeoutTime); tweener.OnComplete(() => { TextTool.ClearText(_promptText); TextTool.SetTextAlpha(_promptText, 1); _nameInput.text = string.Empty; SetInputInteractable(true); }); }
/// <summary> /// 内容开场出现动画效果 /// </summary> /// <returns></returns> IEnumerator PlayContentTextAnim() { string str = _contentText.text; TextTool.ClearText(_contentText); string[] strArr = str.Split('\n'); Text[] txtArr = new Text[strArr.Length]; for (int i = 0; i < txtArr.Length; i++) { txtArr[i] = _contentText.transform.GetChild(i).GetComponent <Text>(); TextTool.RefreshText(txtArr[i], strArr[i]); TextTool.SetTextAlpha(txtArr[i], 0); } yield return(new WaitForSeconds(1.5f)); TweenCallback callback = () => { _lineButton.enabled = true; }; AllTextDoFade(txtArr, txtArr.Length, 2, callback); }
/// <summary> /// 输入正确内容回调 /// </summary> private void OnInputRight() { TextTool.RefreshText(_promptText, _rightPromptStr); TextTool.SetTextAlpha(_promptText, 0); _promptText.DOFade(1, 2f).onComplete = () => { _touchButton.enabled = true; }; }