Ejemplo n.º 1
0
    IEnumerator ChangeStringPeriodically()
    {
        foreach (PeriodicString p in periodicStrings)
        {
            if (p.Full)
            {
                String s = p.Append ? str : "";

                foreach (char c in p.Value)
                {
                    s += c;
                    StringChanged?.Invoke(s);
                    yield return(new WaitForSecondsRealtime(p.Duration));
                }

                if (p.Append && p.Value.Length == 0)
                {
                    StringChanged?.Invoke(s.Substring(0, s.Length - 1));
                    yield return(new WaitForSecondsRealtime(p.Duration));
                }
            }
            else
            {
                StringChanged?.Invoke(p.Value);
                yield return(new WaitForSecondsRealtime(p.Duration));
            }
        }

        Finished?.Invoke();
    }
Ejemplo n.º 2
0
 protected virtual void OnStringChanged(StringChangeEventArgs e)
 {
     StringChanged?.Invoke(this, e);
 }