You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/labs/EasyARDemo/Assets/ImageTargetManager.cs

28 lines
1.1 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using easyar;
public class ImageTargetManager : MonoBehaviour
{
public ImageTrackerFrameFilter Tracker;
void Start()
{
Debug.Log("ImageTargetManager Start");
GameObject imageTarget = (GameObject)Resources.Load("ImageTarget");//"Assets/EasyAR/Prefabs/Primitives/ImageTarget.prefab"
imageTarget.name="ImageTarget-idback";
imageTarget.transform.position = new Vector3(0.1f,0,0.3f);
imageTarget.transform.localScale=new Vector3(0.0856f,0.0856f,0.0856f);
ImageTargetController controller = imageTarget.GetComponent<ImageTargetController>();
controller.ActiveControl= easyar.TargetController.ActiveControlStrategy.HideWhenNotTracking;
//controller.SourceType
//controller.ImageFileSource.PathType
controller.ImageFileSource.Path="idback.jpg";
controller.ImageFileSource.Name="idback";
controller.ImageFileSource.Scale=0.0856f;
controller.Tracker=Tracker;
Instantiate(imageTarget);
}
}