Elin Decompiled Documentation EA 23.102 Nightly
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Pages
Typewriter Class Reference
Inheritance diagram for Typewriter:

Public Member Functions

void OnSetText ()
 
void Skip ()
 

Public Attributes

float speed
 
SoundData sound
 

Properties

bool IsFinished [get]
 

Private Member Functions

void Awake ()
 
void Update ()
 

Private Attributes

UIText text
 
float timer
 
bool isStarted
 
string current
 
string original
 
int index
 

Detailed Description

Definition at line 3 of file Typewriter.cs.

Member Function Documentation

◆ Awake()

void Typewriter.Awake ( )
inlineprivate

Definition at line 33 of file Typewriter.cs.

34 {
35 text = GetComponent<UIText>();
36 }
UIText text
Definition: Typewriter.cs:5

References text.

◆ OnSetText()

void Typewriter.OnSetText ( )
inline

Definition at line 38 of file Typewriter.cs.

39 {
40 original = text.text;
41 current = "";
42 text.text = "";
43 index = 0;
44 timer = 0f;
45 isStarted = true;
46 }
string current
Definition: Typewriter.cs:11
string original
Definition: Typewriter.cs:13
float timer
Definition: Typewriter.cs:7
bool isStarted
Definition: Typewriter.cs:9

References current, index, isStarted, original, text, and timer.

Referenced by UIText.OnSetText().

◆ Skip()

void Typewriter.Skip ( )
inline

Definition at line 48 of file Typewriter.cs.

49 {
50 if (isStarted)
51 {
52 text.text = original;
53 index = original.Length;
54 }
55 }

References index, isStarted, and original.

Referenced by DramaEventTalk.Play().

◆ Update()

void Typewriter.Update ( )
inlineprivate

Definition at line 57 of file Typewriter.cs.

58 {
59 if (!isStarted)
60 {
61 return;
62 }
63 timer -= Time.unscaledDeltaTime;
64 if (!(timer > 0f) && index < original.Length)
65 {
66 string text = original.Substring(index, 1);
67 current += text;
68 index++;
69 this.text.text = current;
70 float num = speed;
71 if (text == "_comma".lang())
72 {
73 num *= 3f;
74 }
75 if (text == "_period".lang())
76 {
77 num *= 6f;
78 }
79 timer += num;
80 if ((bool)sound)
81 {
82 sound.Play();
83 }
84 }
85 }
float speed
Definition: Typewriter.cs:17
SoundData sound
Definition: Typewriter.cs:19

References current, index, isStarted, original, sound, speed, text, and timer.

Member Data Documentation

◆ current

string Typewriter.current
private

Definition at line 11 of file Typewriter.cs.

Referenced by OnSetText(), and Update().

◆ index

int Typewriter.index
private

Definition at line 15 of file Typewriter.cs.

Referenced by OnSetText(), Skip(), and Update().

◆ isStarted

bool Typewriter.isStarted
private

Definition at line 9 of file Typewriter.cs.

Referenced by OnSetText(), Skip(), and Update().

◆ original

string Typewriter.original
private

Definition at line 13 of file Typewriter.cs.

Referenced by OnSetText(), Skip(), and Update().

◆ sound

SoundData Typewriter.sound

Definition at line 19 of file Typewriter.cs.

Referenced by Update().

◆ speed

float Typewriter.speed

Definition at line 17 of file Typewriter.cs.

Referenced by Update().

◆ text

UIText Typewriter.text
private

Definition at line 5 of file Typewriter.cs.

Referenced by Awake(), OnSetText(), and Update().

◆ timer

float Typewriter.timer
private

Definition at line 7 of file Typewriter.cs.

Referenced by OnSetText(), and Update().

Property Documentation

◆ IsFinished

bool Typewriter.IsFinished
get

Definition at line 21 of file Typewriter.cs.

22 {
23 get
24 {
25 if (isStarted)
26 {
27 return index >= original.Length;
28 }
29 return false;
30 }
31 }

Referenced by DramaEventTalk.Play().


The documentation for this class was generated from the following file: