-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathTextProQuadEvent.cs
More file actions
64 lines (50 loc) · 1.56 KB
/
TextProQuadEvent.cs
File metadata and controls
64 lines (50 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Copyright (c) scott.cgi All Rights Reserved.
*
* This source code belongs to project MojoUnity-Packages, which is hosted on GitHub, and licensed under the MIT License.
*
* License: https://github.com/scottcgi/MojoUnity-Packages/blob/main/LICENSE
* GitHub : https://github.com/scottcgi/MojoUnity-Packages
* Package: https://github.com/scottcgi/MojoUnity-Packages/tree/main/MojoUnity-TextPro
*
* Since : 2021-6-1
* Update : 2021-6-1
* Author : scott.cgi
*/
using MojoUnity;
using UnityEngine;
using UnityEngine.UI;
public class TextProQuadEvent : MonoBehaviour
{
private string oldText;
public void Emoji0(Text text)
{
text.CrossFadeColor(Color.red, 0.3f, false, true);
}
public void Emoji1(Text text)
{
text.CrossFadeColor(Color.black, 0.3f, false, true);
}
public void Emoji2(Text text)
{
text.CrossFadeColor(Color.white, 0.3f, false, true);
}
public void Emoji3(TextProQuad textProQuad)
{
this.oldText = textProQuad.OriginalText;
textProQuad.SetTextProText("[Emoji_4, Emoji4]");
}
public void Emoji4(TextProQuad textProQuad)
{
if (this.oldText != null)
{
textProQuad.SetTextProText(this.oldText);
}
}
public void Emoji5(TextProQuad textProQuad)
{
var names = new string[] { "Emoji_0", "Emoji_1", "Emoji_2", "Emoji_3", "Emoji_4", "Emoji_5" };
var name = names[UnityEngine.Random.Range(0, names.Length)];
textProQuad.TextPro.CurrentClickImage.sprite = textProQuad.spriteDict[name];
}
}