Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Applibot.CustomImageBase Class Reference
Inheritance diagram for Applibot.CustomImageBase:
Applibot.DissolveImage Applibot.Glitch Applibot.NormalDissolve Applibot.OutlineImage Applibot.RadialBlurImage Applibot.UICustomBlend

Public Member Functions

Material GetModifiedMaterial (Material baseMaterial)
 
void DestroyMaterial ()
 

Protected Member Functions

virtual void UpdateMaterial (Material baseMaterial)
 
void OnEnable ()
 
void OnDisable ()
 
void OnDestroy ()
 

Protected Attributes

Material material
 

Properties

CanvasScaler canvasScaler [get]
 
Graphic graphic [get]
 

Private Member Functions

void OnDidApplyAnimationProperties ()
 
void SetAtlasInfo ()
 

Private Attributes

Graphic _graphic
 
Image _image
 
CanvasScaler _canvasScaler
 
int _textureRectId = Shader.PropertyToID("_textureRect")
 

Detailed Description

Definition at line 9 of file CustomImageBase.cs.

Member Function Documentation

◆ DestroyMaterial()

void Applibot.CustomImageBase.DestroyMaterial ( )
inline

Definition at line 115 of file CustomImageBase.cs.

116 {
117 UnityEngine.Object.Destroy(material);
118 material = null;
119 }

References Applibot.CustomImageBase.material.

Referenced by Applibot.OutlineImage.Capture(), Applibot.CustomImageBase.OnDestroy(), and Applibot.CustomImageBase.OnDisable().

◆ GetModifiedMaterial()

Material Applibot.CustomImageBase.GetModifiedMaterial ( Material  baseMaterial)
inline

Definition at line 47 of file CustomImageBase.cs.

48 {
49 if (!base.isActiveAndEnabled || graphic == null)
50 {
51 return baseMaterial;
52 }
53 UpdateMaterial(baseMaterial);
55 return material;
56 }
virtual void UpdateMaterial(Material baseMaterial)

References Applibot.CustomImageBase.graphic, Applibot.CustomImageBase.material, Applibot.CustomImageBase.SetAtlasInfo(), and Applibot.CustomImageBase.UpdateMaterial().

◆ OnDestroy()

void Applibot.CustomImageBase.OnDestroy ( )
inlineprotected

Definition at line 107 of file CustomImageBase.cs.

108 {
109 if (material != null)
110 {
112 }
113 }

References Applibot.CustomImageBase.DestroyMaterial(), and Applibot.CustomImageBase.material.

◆ OnDidApplyAnimationProperties()

void Applibot.CustomImageBase.OnDidApplyAnimationProperties ( )
inlineprivate

Definition at line 58 of file CustomImageBase.cs.

59 {
60 if (base.isActiveAndEnabled && !(graphic == null))
61 {
62 graphic.SetMaterialDirty();
63 }
64 }

References Applibot.CustomImageBase.graphic.

◆ OnDisable()

void Applibot.CustomImageBase.OnDisable ( )
inlineprotected

Definition at line 95 of file CustomImageBase.cs.

96 {
97 if (material != null)
98 {
100 }
101 if (graphic != null)
102 {
103 graphic.SetMaterialDirty();
104 }
105 }

References Applibot.CustomImageBase.DestroyMaterial(), Applibot.CustomImageBase.graphic, and Applibot.CustomImageBase.material.

◆ OnEnable()

void Applibot.CustomImageBase.OnEnable ( )
inlineprotected

Definition at line 86 of file CustomImageBase.cs.

87 {
88 if (!(graphic == null))
89 {
90 _image = graphic as Image;
91 graphic.SetMaterialDirty();
92 }
93 }

References Applibot.CustomImageBase._image, and Applibot.CustomImageBase.graphic.

◆ SetAtlasInfo()

void Applibot.CustomImageBase.SetAtlasInfo ( )
inlineprivate

Definition at line 70 of file CustomImageBase.cs.

71 {
72 if (!(_image == null))
73 {
74 if (!_image.sprite.packed)
75 {
76 material.DisableKeyword("USE_ATLAS");
77 return;
78 }
79 Rect textureRect = _image.sprite.textureRect;
80 Vector4 value = new Vector4(textureRect.x, textureRect.y, textureRect.width, textureRect.height);
81 material.SetVector(_textureRectId, value);
82 material.EnableKeyword("USE_ATLAS");
83 }
84 }

References Applibot.CustomImageBase._image, Applibot.CustomImageBase._textureRectId, and Applibot.CustomImageBase.material.

Referenced by Applibot.CustomImageBase.GetModifiedMaterial().

◆ UpdateMaterial()

virtual void Applibot.CustomImageBase.UpdateMaterial ( Material  baseMaterial)
inlineprotectedvirtual

Member Data Documentation

◆ _canvasScaler

CanvasScaler Applibot.CustomImageBase._canvasScaler
private

Definition at line 19 of file CustomImageBase.cs.

◆ _graphic

Graphic Applibot.CustomImageBase._graphic
private

Definition at line 12 of file CustomImageBase.cs.

◆ _image

Image Applibot.CustomImageBase._image
private

◆ _textureRectId

int Applibot.CustomImageBase._textureRectId = Shader.PropertyToID("_textureRect")
private

Definition at line 21 of file CustomImageBase.cs.

Referenced by Applibot.CustomImageBase.SetAtlasInfo().

◆ material

Property Documentation

◆ canvasScaler

CanvasScaler Applibot.CustomImageBase.canvasScaler
getprotected

Definition at line 23 of file CustomImageBase.cs.

24 {
25 get
26 {
27 if (_canvasScaler == null)
28 {
29 _canvasScaler = graphic.canvas.GetComponent<CanvasScaler>();
30 }
31 return _canvasScaler;
32 }
33 }

◆ graphic

Graphic Applibot.CustomImageBase.graphic
get

Definition at line 35 of file CustomImageBase.cs.

36 {
37 get
38 {
39 if (_graphic == null)
40 {
41 _graphic = GetComponent<Graphic>();
42 }
43 return _graphic;
44 }
45 }

Referenced by Applibot.CustomImageBase.GetModifiedMaterial(), Applibot.CustomImageBase.OnDidApplyAnimationProperties(), Applibot.CustomImageBase.OnDisable(), and Applibot.CustomImageBase.OnEnable().


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