Elin Decompiled Documentation
EA 23.102 Nightly
Toggle main menu visibility
Main Page
Namespaces
Namespace List
Namespace Members
All
Functions
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
w
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Events
Files
File List
File Members
All
$
a
b
c
e
f
g
h
i
l
m
n
o
p
r
s
t
v
w
z
Functions
Variables
Enumerations
a
b
c
e
f
g
h
i
l
m
n
o
p
r
s
t
v
w
z
•
All
Classes
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Properties
Events
Pages
Loading...
Searching...
No Matches
Typewriter.cs
Go to the documentation of this file.
1
using
UnityEngine;
2
3
public
class
Typewriter
: MonoBehaviour
4
{
5
private
UIText
text
;
6
7
private
float
timer
;
8
9
private
bool
isStarted
;
10
11
private
string
current
;
12
13
private
string
original
;
14
15
private
int
index
;
16
17
public
float
speed
;
18
19
public
SoundData
sound
;
20
21
public
bool
IsFinished
22
{
23
get
24
{
25
if
(
isStarted
)
26
{
27
return
index
>=
original
.Length;
28
}
29
return
false
;
30
}
31
}
32
33
private
void
Awake
()
34
{
35
text
= GetComponent<UIText>();
36
}
37
38
public
void
OnSetText
()
39
{
40
original
=
text
.text;
41
current
=
""
;
42
text.text =
""
;
43
index
= 0;
44
timer
= 0f;
45
isStarted
=
true
;
46
}
47
48
public
void
Skip
()
49
{
50
if
(
isStarted
)
51
{
52
text.text =
original
;
53
index
=
original
.Length;
54
}
55
}
56
57
private
void
Update
()
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
}
86
}
Typewriter
Definition:
Typewriter.cs:4
Typewriter.Update
void Update()
Definition:
Typewriter.cs:57
Typewriter.Awake
void Awake()
Definition:
Typewriter.cs:33
Typewriter.speed
float speed
Definition:
Typewriter.cs:17
Typewriter.current
string current
Definition:
Typewriter.cs:11
Typewriter.Skip
void Skip()
Definition:
Typewriter.cs:48
Typewriter.original
string original
Definition:
Typewriter.cs:13
Typewriter.text
UIText text
Definition:
Typewriter.cs:5
Typewriter.IsFinished
bool IsFinished
Definition:
Typewriter.cs:22
Typewriter.index
int index
Definition:
Typewriter.cs:15
Typewriter.sound
SoundData sound
Definition:
Typewriter.cs:19
Typewriter.OnSetText
void OnSetText()
Definition:
Typewriter.cs:38
Typewriter.timer
float timer
Definition:
Typewriter.cs:7
Typewriter.isStarted
bool isStarted
Definition:
Typewriter.cs:9
UIText
Definition:
UIText.cs:6
Elin
Plugins.UI
Typewriter.cs
Generated by
1.9.6