9 using System.Collections.Generic;
10 using System.Collections.Specialized;
23 Renderer myRenderer = GetComponent<Renderer>();
24 myRenderer.enabled =
false;
33 "0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9" 42 Debug.Log(
"OnTrackerDataFileChanged : " + trackerFileName);
45 private void SetTargetTexture(
string textureName)
47 if (File.Exists(textureName))
49 StartCoroutine(
MaxstUtil.loadImageFromFileWithSizeAndTexture(Application.streamingAssetsPath +
"/../../" + textureName, (width, height, texture) => {
50 Texture2D localTexture = texture;
54 MeshFilter imagePlaneMeshFilter = gameObject.GetComponent<MeshFilter>();
55 if (imagePlaneMeshFilter.sharedMesh == null)
57 imagePlaneMeshFilter.sharedMesh = new Mesh();
58 imagePlaneMeshFilter.sharedMesh.name =
"ImagePlane";
61 float localWidth = (float)width * 0.5f;
62 float localHeight = (float)height * 0.5f;
63 imagePlaneMeshFilter.sharedMesh.vertices = new Vector3[]
65 new Vector3(-localWidth, -localHeight, 0.0f),
66 new Vector3(-localWidth, localHeight, 0.0f),
67 new Vector3(localWidth, -localHeight, 0.0f),
68 new Vector3(localWidth, localHeight, 0.0f)
71 imagePlaneMeshFilter.sharedMesh.triangles = new int[] { 0, 1, 2, 2, 1, 3 };
72 imagePlaneMeshFilter.sharedMesh.uv = new Vector2[]
80 if (gameObject.GetComponent<MeshRenderer>().sharedMaterial == null)
82 gameObject.GetComponent<MeshRenderer>().sharedMaterial = new Material(Shader.Find(
"Unlit/Texture"));
85 gameObject.GetComponent<MeshRenderer>().sharedMaterial.SetTexture(
"_MainTex", texture);
Serve frame marker tracking. This is not working current version!
readonly string [] TrackableList
Marker name list in temporary
Parent class of all TrackableBehaviour. Save tracking file's id (uuid), name, path etc...
override void OnTrackerDataFileChanged(string trackerFileName)
Notify tracking file changed and change target image texture