Skip to content

Commit cde7b8d

Browse files
committed
Fixed avatar generation not working in builds
Created two materials under /Resources so that shaders are always included in the build.
1 parent 38b3877 commit cde7b8d

5 files changed

Lines changed: 121 additions & 1 deletion

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!21 &2100000
4+
Material:
5+
serializedVersion: 8
6+
m_ObjectHideFlags: 0
7+
m_CorrespondingSourceObject: {fileID: 0}
8+
m_PrefabInstance: {fileID: 0}
9+
m_PrefabAsset: {fileID: 0}
10+
m_Name: AvatarGradientMaterial
11+
m_Shader: {fileID: 4800000, guid: 832980ba13231854d88a322b288f3685, type: 3}
12+
m_Parent: {fileID: 0}
13+
m_ModifiedSerializedProperties: 0
14+
m_ValidKeywords: []
15+
m_InvalidKeywords: []
16+
m_LightmapFlags: 4
17+
m_EnableInstancingVariants: 0
18+
m_DoubleSidedGI: 0
19+
m_CustomRenderQueue: -1
20+
stringTagMap: {}
21+
disabledShaderPasses: []
22+
m_LockedProperties:
23+
m_SavedProperties:
24+
serializedVersion: 3
25+
m_TexEnvs:
26+
- _AlphaTex:
27+
m_Texture: {fileID: 0}
28+
m_Scale: {x: 1, y: 1}
29+
m_Offset: {x: 0, y: 0}
30+
- _MainTex:
31+
m_Texture: {fileID: 0}
32+
m_Scale: {x: 1, y: 1}
33+
m_Offset: {x: 0, y: 0}
34+
- _MaskTex:
35+
m_Texture: {fileID: 0}
36+
m_Scale: {x: 1, y: 1}
37+
m_Offset: {x: 0, y: 0}
38+
- _NormalMap:
39+
m_Texture: {fileID: 0}
40+
m_Scale: {x: 1, y: 1}
41+
m_Offset: {x: 0, y: 0}
42+
m_Ints: []
43+
m_Floats:
44+
- _EnableExternalAlpha: 0
45+
m_Colors:
46+
- _Color: {r: 1, g: 1, b: 1, a: 1}
47+
- _Flip: {r: 1, g: 1, b: 1, a: 1}
48+
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
49+
m_BuildTextureStacks: []

Packages/com.walletconnect.web3modal/Resources/Fonts & Materials/AvatarGradientMaterial.mat.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!21 &2100000
4+
Material:
5+
serializedVersion: 8
6+
m_ObjectHideFlags: 0
7+
m_CorrespondingSourceObject: {fileID: 0}
8+
m_PrefabInstance: {fileID: 0}
9+
m_PrefabAsset: {fileID: 0}
10+
m_Name: VectorDemultiplyMaterial
11+
m_Shader: {fileID: 4800000, guid: 39d5aa26339b5e94d9310ce4f69919f6, type: 3}
12+
m_Parent: {fileID: 0}
13+
m_ModifiedSerializedProperties: 0
14+
m_ValidKeywords: []
15+
m_InvalidKeywords: []
16+
m_LightmapFlags: 4
17+
m_EnableInstancingVariants: 0
18+
m_DoubleSidedGI: 0
19+
m_CustomRenderQueue: -1
20+
stringTagMap: {}
21+
disabledShaderPasses: []
22+
m_LockedProperties:
23+
m_SavedProperties:
24+
serializedVersion: 3
25+
m_TexEnvs:
26+
- _AlphaTex:
27+
m_Texture: {fileID: 0}
28+
m_Scale: {x: 1, y: 1}
29+
m_Offset: {x: 0, y: 0}
30+
- _MainTex:
31+
m_Texture: {fileID: 0}
32+
m_Scale: {x: 1, y: 1}
33+
m_Offset: {x: 0, y: 0}
34+
- _MaskTex:
35+
m_Texture: {fileID: 0}
36+
m_Scale: {x: 1, y: 1}
37+
m_Offset: {x: 0, y: 0}
38+
- _NormalMap:
39+
m_Texture: {fileID: 0}
40+
m_Scale: {x: 1, y: 1}
41+
m_Offset: {x: 0, y: 0}
42+
m_Ints: []
43+
m_Floats:
44+
- _ColorMask: 15
45+
- _EnableExternalAlpha: 0
46+
- _Stencil: 0
47+
- _StencilComp: 8
48+
- _StencilOp: 0
49+
- _StencilReadMask: 255
50+
- _StencilWriteMask: 255
51+
m_Colors:
52+
- _Color: {r: 1, g: 1, b: 1, a: 1}
53+
- _Flip: {r: 1, g: 1, b: 1, a: 1}
54+
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
55+
m_BuildTextureStacks: []

Packages/com.walletconnect.web3modal/Resources/Fonts & Materials/VectorDemultiplyMaterial.mat.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/com.walletconnect.web3modal/Runtime/Utils/UiUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static Texture2D GenerateAvatarTexture(string address)
6262
var geoms = VectorUtils.TessellateScene(scene, tessOptions);
6363
var sprite = VectorUtils.BuildSprite(geoms, 10.0f, VectorUtils.Alignment.Center, Vector2.zero, 16, true);
6464

65-
var mat = new Material(Shader.Find("Unlit/VectorGradient"));
65+
var mat = Resources.Load<Material>("Fonts & Materials/AvatarGradientMaterial");
6666
var texture = VectorUtils.RenderSpriteToTexture2D(sprite, 128, 128, mat);
6767

6868
return texture;

0 commit comments

Comments
 (0)