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

Public Types

enum  MyCustomBlendMode : byte {
  Normal , LinearDodge , Darken , Multiply ,
  Subtract , Lighten
}
 

Protected Member Functions

override void UpdateMaterial (Material baseMaterial)
 
- Protected Member Functions inherited from Applibot.CustomImageBase
virtual void UpdateMaterial (Material baseMaterial)
 
void OnEnable ()
 
void OnDisable ()
 
void OnDestroy ()
 

Private Attributes

MyCustomBlendMode _blendMode
 
readonly int _SrcFactor = Shader.PropertyToID("_SrcFactor")
 
readonly int _DstFactor = Shader.PropertyToID("_DstFactor")
 
readonly int _BlendOp = Shader.PropertyToID("_BlendOp")
 

Additional Inherited Members

- Public Member Functions inherited from Applibot.CustomImageBase
Material GetModifiedMaterial (Material baseMaterial)
 
void DestroyMaterial ()
 
- Protected Attributes inherited from Applibot.CustomImageBase
Material material
 
- Properties inherited from Applibot.CustomImageBase
CanvasScaler canvasScaler [get]
 
Graphic graphic [get]
 

Detailed Description

Definition at line 6 of file UICustomBlend.cs.

Member Enumeration Documentation

◆ MyCustomBlendMode

Member Function Documentation

◆ UpdateMaterial()

override void Applibot.UICustomBlend.UpdateMaterial ( Material  baseMaterial)
inlineprotectedvirtual

Reimplemented from Applibot.CustomImageBase.

Definition at line 27 of file UICustomBlend.cs.

28 {
29 if (material == null)
30 {
31 material = new Material(Shader.Find("Applibot/UI/CustomBlend"));
32 material.hideFlags = HideFlags.HideAndDontSave;
33 }
34 material.enabledKeywords = new LocalKeyword[0];
35 switch (_blendMode)
36 {
37 case MyCustomBlendMode.Normal:
38 material.SetInt(_SrcFactor, 1);
39 material.SetInt(_DstFactor, 10);
40 material.SetInt(_BlendOp, 0);
41 break;
42 case MyCustomBlendMode.LinearDodge:
43 material.SetInt(_SrcFactor, 5);
44 material.SetInt(_DstFactor, 1);
45 material.SetInt(_BlendOp, 0);
46 break;
47 case MyCustomBlendMode.Multiply:
48 material.SetInt(_SrcFactor, 0);
49 material.SetInt(_DstFactor, 3);
50 material.SetInt(_BlendOp, 0);
51 break;
52 case MyCustomBlendMode.Darken:
53 material.SetInt(_SrcFactor, 1);
54 material.SetInt(_DstFactor, 1);
55 material.SetInt(_BlendOp, 3);
56 break;
57 case MyCustomBlendMode.Subtract:
58 material.SetInt(_SrcFactor, 1);
59 material.SetInt(_DstFactor, 1);
60 material.SetInt(_BlendOp, 2);
61 break;
62 case MyCustomBlendMode.Lighten:
63 material.SetInt(_SrcFactor, 1);
64 material.SetInt(_DstFactor, 1);
65 material.SetInt(_BlendOp, 4);
66 break;
67 }
68 material.EnableKeyword(_blendMode.ToString());
69 }
readonly int _DstFactor
MyCustomBlendMode _blendMode
readonly int _SrcFactor

References Applibot.UICustomBlend._blendMode, Applibot.UICustomBlend._BlendOp, Applibot.UICustomBlend._DstFactor, Applibot.UICustomBlend._SrcFactor, Material, and Applibot.CustomImageBase.material.

Member Data Documentation

◆ _blendMode

MyCustomBlendMode Applibot.UICustomBlend._blendMode
private

Definition at line 19 of file UICustomBlend.cs.

Referenced by Applibot.UICustomBlend.UpdateMaterial().

◆ _BlendOp

readonly int Applibot.UICustomBlend._BlendOp = Shader.PropertyToID("_BlendOp")
private

Definition at line 25 of file UICustomBlend.cs.

Referenced by Applibot.UICustomBlend.UpdateMaterial().

◆ _DstFactor

readonly int Applibot.UICustomBlend._DstFactor = Shader.PropertyToID("_DstFactor")
private

Definition at line 23 of file UICustomBlend.cs.

Referenced by Applibot.UICustomBlend.UpdateMaterial().

◆ _SrcFactor

readonly int Applibot.UICustomBlend._SrcFactor = Shader.PropertyToID("_SrcFactor")
private

Definition at line 21 of file UICustomBlend.cs.

Referenced by Applibot.UICustomBlend.UpdateMaterial().


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