6 using System.Collections.Generic;
21 get {
return instance; }
24 private System.IntPtr invalidImagePtr = IntPtr.Zero;
25 private System.IntPtr freeImagePtr = IntPtr.Zero;
33 internal GameObject CreateWartermarkObject(
int signatureType)
35 GameObject watermark =
new GameObject(
"SDKLogo");
37 Renderer tRenderer = watermark.AddComponent<MeshRenderer>();
38 tRenderer.shadowCastingMode = ShadowCastingMode.Off;
39 tRenderer.receiveShadows =
false;
41 Shader tShader = Resources.Load<Shader>(
"Shader/TransparentSurface");
44 tShader = Shader.Find(
"Unlit/Texture");
46 tRenderer.material =
new Material(tShader);
48 Texture2D texture = null;
50 if (signatureType == 1)
52 texture =
new Texture2D(115, 30, TextureFormat.RGBA32,
false);
53 texture.LoadRawTextureData(freeImagePtr, 115 * 30 * 4);
57 texture =
new Texture2D(106, 38, TextureFormat.RGBA32,
false);
58 texture.LoadRawTextureData(invalidImagePtr, 115 * 30 * 4);
62 tRenderer.material.mainTexture = texture;
64 MeshFilter tMeshFilter = watermark.AddComponent<MeshFilter>();
65 tMeshFilter.mesh =
new Mesh();
66 tMeshFilter.mesh.vertices =
new Vector3[]
68 new Vector3(-1, 0, -1) * 0.5f,
69 new Vector3(-1, 0, 1) * 0.5f,
70 new Vector3(1, 0, -1) * 0.5f,
71 new Vector3(1, 0, 1) * 0.5f
74 tMeshFilter.mesh.triangles =
new int[] { 0, 1, 2, 2, 1, 3 };
75 tMeshFilter.mesh.uv =
new Vector2[]
83 tMeshFilter.mesh.RecalculateNormals();
84 tMeshFilter.mesh.RecalculateBounds();
86 watermark.transform.localScale =
new Vector3(1.0f, 1.0f, -1.0f);