使用Vuforia& amp; amp; amp; amp ;;;;;;    仅创建一次具有接地平面检测的对象.统一

使用Vuforia& amp; amp; amp; amp ;;;;;;    仅创建一次具有接地平面检测的对象.统一

问题描述:

我正在尝试使用Unity& amp;创建一个AR应用程序; Vuforia.我有一个3D模型,当检测到地平面时需要生成该模型,但这仅需要发生一次. Vuforia的工作方式是,当检测到新飞机时,它会继续生成对象.所以我需要做的是要么只检测平面一次,要么只产生一次物体.由于我是Unity新手,因此需要帮助.很棒,如果有人可以告诉我实现这一目标我需要做些什么.

I am trying to create an AR app using Unity & Vuforia. I have a 3D model that needs to be spawned when ground plane is detected.But this needs to happen only once. The way Vuforia work is, it keeps on spawning objects when new plane is detected. So what i need to do is either detect plane only once or spawn the object only once. As i am new to Unity, i need help doing this. Great if someone could tell me what i need to do to achieve this.

在您的应用中,您应该在某个地方的Plane Finder对象中默认设置了以下属性

In your app you should have a Plane Finder object somewhere with the following properties set by default

Plane Finder对象具有附加的行为"组件,如果找到了平面,则该组件将调用Position Content方法.该方法属于Content Positioning Behaviour,它构成了Ground Plane Stage的实例(克隆).为了避免出现多个实例,您应该导入位于此处的vuforia Deploy Stage Once脚本:

The Plane Finder object has a Behaviour component attached that calls a Position Content method if a plane was found. That method belongs to the Content Positioning Behaviour and it makes an instance (Clone) of your Ground Plane Stage. In order to avoid more than one instance you should import the vuforia Deploy Stage Once script located here: