Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        unityARAnchorManager = new ExAnchorManager();
        unityARAnchorManager.Init();

        ExUnityARUtility.InitializePlanePrefab(planePrefab);
    }
Exemplo n.º 2
0
    public void AddAnchor(ARPlaneAnchor arPlaneAnchor)
    {
        Debug.LogWarning("AddAnchor!!!!");

        //Planeが追加されたら呼ばれる。
        ExARKitPlaneMeshRender go = ExUnityARUtility.CreatePlaneInScene(arPlaneAnchor); ////////////生成

        go.gameObject.AddComponent <DontDestroyOnLoad> ();                              //this is so these GOs persist across scene loads
        ARPlaneAnchorGameObject arpag = new ARPlaneAnchorGameObject();

        arpag.planeAnchor = arPlaneAnchor;
        arpag.gameObject  = go.gameObject;
        planeAnchorMap.Add(arPlaneAnchor.identifier, arpag); ////////////ディクショナリーにAdd
    }
Exemplo n.º 3
0
 public void UpdateAnchor(ARPlaneAnchor arPlaneAnchor)
 {
     Debug.LogWarning("updateAnchor!!!!");
     //ancharの更新
     if (planeAnchorMap.ContainsKey(arPlaneAnchor.identifier))
     {
         ARPlaneAnchorGameObject arpag = planeAnchorMap [arPlaneAnchor.identifier];
         //planeをアップデート
         ExUnityARUtility.UpdatePlaneWithAnchorTransform(
             arpag.gameObject.transform.GetComponent <ExARKitPlaneMeshRender>(),
             arPlaneAnchor
             );
         arpag.planeAnchor = arPlaneAnchor;
         planeAnchorMap [arPlaneAnchor.identifier] = arpag;
     }
 }