- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正在制作 AR 纸牌游戏,您需要在游戏卡上选择一对相同的动画。有 16 种不同的游戏卡,每 2 种都有使用 Vuforia 转换的相同动画。可以同时跟踪 2 张游戏卡。如果正在跟踪的两张卡上的动画相同,我该如何比较?我是编码新手,但需要完成此操作。
public void OnTrackableStateChanged(TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus)
{
if (newStatus == TrackableBehaviour.Status.DETECTED ||
newStatus == TrackableBehaviour.Status.TRACKED ||
newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
{
activeTrackables = sm.GetActiveTrackableBehaviours ();
MatchCount.cardCount++;
if (MatchCount.cardCount == 2) { //if there are 2 tracked cards
//Compare them
if ( /* first projected animation */ == /* second projected animation */) {
MatchCount.matches--;
}
matchText.text = "number of matches: " + MatchCount.matches;
}
}
else
{
MatchCount.cardCount--;
if (MatchCount.cardCount < 0) {
MatchCount.cardCount = 0;
}
matchText.text = "number of matches: " + MatchCount.matches;
}
}
最佳答案
您可能需要将游戏对象作为游戏对象数组添加到代码中。然后尝试使用 vuforias on tracker lost and found 在运行时将变量设置为“Activity ”卡片/图像目标。
一旦您知道启用了哪些卡片,您就可以比较这些卡片并找到您想要的匹配项。
这是一个指向 vuforias 板的链接,用于查找 Activity 目标。
这是一个指南
https://developer.vuforia.com/forum/faq/unity-how-do-i-get-list-active-trackables
关于c# - 比较游戏对象 增强现实游戏,Unity,Vuforia,C#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43747810/
笙歌 痞性. 剩余 青怏 洒脱 现实 搁浅° 软萌 路途 娼妓 离骚 逐你 微尘 迷魂 ▼ 扎心 堇夏 残年っ ╭淡妆╮ 24K.纯疯 隐痛
我正在尝试不费吹灰之力地实现完全有效的持久性无知。不过我有很多问题: 最简单的选项 这真的很简单——可以像在 SOA 中那样使用 Spring Data 注释对实体进行注释(但让它们真正执行逻辑)?除
我想完成一项简单的任务。 我在可变宽度容器中有一个图像。 容器的宽度可以为 300、400、700 或 900 像素。这是通过媒体查询完成的图像应占据该容器的所有宽度。所以它也将是 300、400、7
我在使用 Storyboards AutoRotation 和 iPhone 时遇到问题。我已经将一个非常简单的项目与 3 个 View Controller 放在一起,并将其上传到 gitHub 以
我是一名优秀的程序员,十分优秀!