Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
PopItemText.cs
Go to the documentation of this file.
1using UnityEngine;
2using UnityEngine.UI;
3
4public class PopItemText : PopItem
5{
6 public UIText text;
7
8 public Image image;
9
11
12 public bool setNativeSize = true;
13
14 public void SetText(string s, Sprite sprite = null, Color c = default(Color))
15 {
16 if ((bool)text)
17 {
18 if (c != default(Color))
19 {
20 text.SetText(s, c);
21 }
22 else
23 {
24 text.SetText(s);
25 }
26 text.SetActive(!s.IsEmpty());
27 }
28 if ((bool)image)
29 {
30 image.SetActive(sprite);
31 if ((bool)sprite)
32 {
33 image.sprite = sprite;
34 if (setNativeSize)
35 {
36 image.SetNativeSize();
37 }
38 }
39 }
40 if ((bool)outline2)
41 {
42 outline2.enabled = PopManager.outlineAlpha >= 0;
43 Color effectColor = outline2.effectColor;
44 effectColor.a = 0.01f * (float)PopManager.outlineAlpha;
45 outline2.effectColor = effectColor;
46 }
47 }
48}
void SetText(string s, Sprite sprite=null, Color c=default(Color))
Definition: PopItemText.cs:14
UIText text
Definition: PopItemText.cs:6
Outline outline2
Definition: PopItemText.cs:10
bool setNativeSize
Definition: PopItemText.cs:12
Image image
Definition: PopItemText.cs:8
static int outlineAlpha
Definition: PopManager.cs:9
Definition: UIText.cs:6
void SetText(string s)
Definition: UIText.cs:159