Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UIRawImage.cs
Go to the documentation of this file.
1using System.Collections;
2using UnityEngine;
3using UnityEngine.UI;
4
5public class UIRawImage : RawImage, IUISkin
6{
8
10
11 public bool animate;
12
13 public Vector2 animeSpeed;
14
15 protected override void Awake()
16 {
17 ApplySkin();
18 base.Awake();
19 }
20
21 protected override void OnEnable()
22 {
23 if (animate)
24 {
25 StartCoroutine("Animate");
26 }
27 base.OnEnable();
28 }
29
30 protected override void OnDisable()
31 {
32 if (animate)
33 {
34 StopCoroutine("Animate");
35 }
36 base.OnDisable();
37 }
38
39 public IEnumerator Animate()
40 {
41 while (true)
42 {
43 Rect rect = base.uvRect;
44 rect.x += animeSpeed.x * Time.smoothDeltaTime;
45 rect.y += animeSpeed.y * Time.smoothDeltaTime;
46 base.uvRect = rect;
47 yield return true;
48 }
49 }
50
51 public void ApplySkin()
52 {
54 baseSkinRoot.ApplySkin(this);
55 if (imageType == ImageType.Line)
56 {
57 color = baseSkinRoot.Colors.colorLine;
58 }
59 }
60
61 protected override void OnPopulateMesh(VertexHelper vh)
62 {
63 if (color.a == 0f || !base.texture)
64 {
65 vh.Clear();
66 }
67 else
68 {
69 base.OnPopulateMesh(vh);
70 }
71 }
72}
ImageType
Definition: ImageType.cs:2
virtual void ApplySkin(UIImage t)
Definition: BaseSkinRoot.cs:16
virtual SkinColorProfile Colors
Definition: BaseSkinRoot.cs:7
SkinRootStatic currentSkin
Definition: SkinManager.cs:53
static SkinManager Instance
Definition: SkinManager.cs:78
IEnumerator Animate()
Definition: UIRawImage.cs:39
bool animate
Definition: UIRawImage.cs:11
override void OnEnable()
Definition: UIRawImage.cs:21
override void Awake()
Definition: UIRawImage.cs:15
BaseSkinRoot skinRoot
Definition: UIRawImage.cs:9
override void OnDisable()
Definition: UIRawImage.cs:30
Vector2 animeSpeed
Definition: UIRawImage.cs:13
ImageType imageType
Definition: UIRawImage.cs:7
override void OnPopulateMesh(VertexHelper vh)
Definition: UIRawImage.cs:61
void ApplySkin()
Definition: UIRawImage.cs:51