题目内容
以下代码可以实现通过Vuforia虚拟按钮控制小车拆解动画效果,请填空: using System.Collections; using System.Collections.Generic; using UnityEngine; using ______ ; public class MyVirtualButtonBehaviour : MonoBehaviour, IVirtualButtonEventHandler { ______ vbs; //定义所有的虚拟按钮事件组件 public Animation carAnim; void Start() { vbs = GetComponentsInChildren(); foreach (var vb in vbs) { vb.RegisterEventHandler(this); } } void Update() { } public void OnButtonPressed(VirtualButtonBehaviour vb) { switch (vb.VirtualButtonName) { case "Color": break; case "Light": break; //播放小车拆解动画 case "Boom": carAnim["CarAnimation"].speed = 1; carAnim["CarAnimation"].normalizedTime = 0; carAnim.Play(); break; default: break; } } public void OnButtonReleased(VirtualButtonBehaviour vb) { switch (vb.VirtualButtonName) { case "Color": break; case "Light": break; //复原小车初始画面 case "Boom": carAnim["CarAnimation"].speed = -1; carAnim["CarAnimation"].normalizedTime = ______ ; carAnim.Play(); break; default: break; } } }
查看答案
搜索结果不匹配?点我反馈