I'm using Vuforia and unity for my AR App. which has more than 2 models/image targets. To zoom in and out I used Lean Touch.
But the problem is both will get zoom on pinching .
I want only one to zoom which is currently detected.. OR
I want reset Scale component of my 3D model/models on OnTrackingLost() function in DefaultTrackableEventHandler so that when it detects other one it shows on original scale (as i set max sim images detected to one).
Thanks !
EDIT :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class rscale : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKey (KeyCode.V)) {
transform.localScale = new Vector3 (4f, 4f, 4f);
Debug.Log("scaling to 4");
}
}
}
但这个简单的脚本也不起作用?
您进行缩放的方法,添加:
if(this.gameObject.activeSelf == false){ return; }
// Scaling process
因此,如果您在所有对象上运行代码,则只有活动对象才会受到影响。考虑到您在丢失跟踪时停用对象。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)