示例#1
0
    /// <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);
        });
    }
示例#2
0
    /// <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);
    }
示例#3
0
 private void InitDataFromKeys(UILevel003Key key)
 {
     TextTool.RefreshText(_promptText, key.promptStr);
 }
示例#4
0
 /// <summary>
 /// 输入正确内容回调
 /// </summary>
 private void OnInputRight()
 {
     TextTool.RefreshText(_promptText, _rightPromptStr);
     TextTool.SetTextAlpha(_promptText, 0);
     _promptText.DOFade(1, 2f).onComplete = () => { _touchButton.enabled = true; };
 }