8 [ColorUsage(
true,
true)]
19 private readonly
int _SrcFactor = Shader.PropertyToID(
"_SrcFactor");
21 private readonly
int _DstFactor = Shader.PropertyToID(
"_DstFactor");
27 Shader shader = Shader.Find(
"Applibot/UI/Outline");
33 if (base.canvasScaler !=
null)
35 Vector2 referenceResolution = base.canvasScaler.referenceResolution;
36 Vector2 one = Vector2.one;
39 Rect textureRect =
_image.sprite.textureRect;
40 one =
new Vector2(textureRect.width, textureRect.height);
44 Texture mainTexture = base.graphic.mainTexture;
45 one =
new Vector2(mainTexture.width, mainTexture.height);
47 float x = one.x / referenceResolution.x;
48 float y = one.y / referenceResolution.y;
49 material.SetVector(
"_scaleFactor",
new Vector4(x, y));
55 _image = base.graphic as Image;
67 if (TryGetComponent<RawImage>(out var component))
69 Texture mainTexture = base.graphic.mainTexture;
70 float width = (base.transform as RectTransform).rect.width;
71 float height = (base.transform as RectTransform).rect.height;
72 RenderTexture renderTexture =
new RenderTexture((
int)width, (
int)height, 0, RenderTextureFormat.ARGBHalf);
73 Graphics.Blit(mainTexture, renderTexture,
material);
74 component.texture = renderTexture;
override void UpdateMaterial(Material baseMaterial)