/// <summary> /// 現在の文字列が適切な場合に更新します。 /// </summary> /// <param name="func">スキャン種類。</param> /// <returns>更新できたかどうか。</returns> public bool CheckAdvance(Func <char, bool> func) { if (!func(Current)) { return(false); } Current = Itext.AdvancePeek(); return(true); }
/* * IEnumerator Timer(){ * yield return new WaitForSeconds(3f); * Itext.SetActive(false); * } */ void Update() { if (time > 0) { time -= Time.deltaTime; Itext.SetActive(true); Itext.GetComponent <TextMeshProUGUI>().text = "I will disappear in " + Mathf.Ceil(time); } else { Itext.SetActive(false); } }
/// <summary> /// 現在の文字列が適切な場合に追加し、次に進めます。 /// </summary> public void AddAdvance() { Scan += Current; Current = Itext.AdvancePeek(); }
/// <summary> /// 文字列を進めます。 /// </summary> public void Advance() { Current = Itext.AdvancePeek(); }