Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class WelcomeTextController : MonoBehaviour
- {
- public Text text;
- public float typingDuration;
- [TextArea(10, 10)]
- public string welcomeText;
- void Start()
- {
- new Interpolation(t => SetString(str, ratio))
- .Duration(typingDuration)
- .Build(this)
- .Play();
- }
- void SetString(string str, float ratio)
- {
- this.text.text = str.Substring(0, (int) (ratio * str.Length)));
- }
- }
Add Comment
Please, Sign In to add comment