Elin Decompiled Documentation
EA 23.102 Nightly
Loading...
Searching...
No Matches
UICustomBlend.cs
Go to the documentation of this file.
1
using
UnityEngine;
2
using
UnityEngine.Rendering;
3
4
namespace
Applibot
;
5
6
public
class
UICustomBlend
:
CustomImageBase
7
{
8
public
enum
MyCustomBlendMode
:
byte
9
{
10
Normal
,
11
LinearDodge
,
12
Darken
,
13
Multiply
,
14
Subtract
,
15
Lighten
16
}
17
18
[SerializeField]
19
private
MyCustomBlendMode
_blendMode
;
20
21
private
readonly
int
_SrcFactor
= Shader.PropertyToID(
"_SrcFactor"
);
22
23
private
readonly
int
_DstFactor
= Shader.PropertyToID(
"_DstFactor"
);
24
25
private
readonly
int
_BlendOp
= Shader.PropertyToID(
"_BlendOp"
);
26
27
protected
override
void
UpdateMaterial
(
Material
baseMaterial)
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
}
70
}
ObjValType.Material
@ Material
Applibot.CustomImageBase
Definition:
CustomImageBase.cs:10
Applibot.CustomImageBase.material
Material material
Definition:
CustomImageBase.cs:17
Applibot.UICustomBlend
Definition:
UICustomBlend.cs:7
Applibot.UICustomBlend._DstFactor
readonly int _DstFactor
Definition:
UICustomBlend.cs:23
Applibot.UICustomBlend.UpdateMaterial
override void UpdateMaterial(Material baseMaterial)
Definition:
UICustomBlend.cs:27
Applibot.UICustomBlend._blendMode
MyCustomBlendMode _blendMode
Definition:
UICustomBlend.cs:19
Applibot.UICustomBlend._BlendOp
readonly int _BlendOp
Definition:
UICustomBlend.cs:25
Applibot.UICustomBlend._SrcFactor
readonly int _SrcFactor
Definition:
UICustomBlend.cs:21
Applibot.UICustomBlend.MyCustomBlendMode
MyCustomBlendMode
Definition:
UICustomBlend.cs:9
Applibot.UICustomBlend.MyCustomBlendMode.Lighten
@ Lighten
Applibot.UICustomBlend.MyCustomBlendMode.Subtract
@ Subtract
Applibot.UICustomBlend.MyCustomBlendMode.LinearDodge
@ LinearDodge
Applibot.UICustomBlend.MyCustomBlendMode.Normal
@ Normal
Applibot.UICustomBlend.MyCustomBlendMode.Multiply
@ Multiply
Applibot.UICustomBlend.MyCustomBlendMode.Darken
@ Darken
Applibot
Definition:
CustomImageBase.cs:5
Elin
Plugins.UI
Applibot
UICustomBlend.cs
Generated by
1.9.6