public void DisableObjects(Vuforia.VuMarkTarget vumarkTargetTracked) { previousGameObject = detectedGameObject; previousTabsManager = myTabsManagerRef; bool isAnimationDone = true; //checks if all the animations on the detected object were done. foreach (Animator anim in detectedGameObject.GetComponentsInChildren <Animator>()) { isAnimationDone = isAnimationDone && anim.GetCurrentAnimatorStateInfo(0).normalizedTime >= 1; Debug.Log("<color='red'> animator time </color>" + anim.name + " " + anim.GetCurrentAnimatorStateInfo(0).IsName("main") + ": " + anim.GetCurrentAnimatorStateInfo(0).normalizedTime); } if (isAnimationDone) { curState = TrackingState.Waiting; } else { curState = TrackingState.Lost; } if (messenger != null && !SlidingWindow.IsOpen()) { messenger.ShowMessage("Please aim your camera at our poster"); } detectedGameObject.SetActive(false); ToggleArrows(false); }
// Update is called once per frame void Update() { switch (scrollerState) { case UIElementState.Active: if (!SlidingWindow.IsOpen()) { UpdateInput(); } break; case UIElementState.TransitionOut: scrollValue += 0.1f * (idleValue - scrollValue); if (Mathf.Abs(idleValue - scrollValue) < 0.01f) { ForceIdle(); } break; case UIElementState.TransitionIn: scrollValue -= 0.1f * scrollValue; if (Mathf.Abs(scrollValue) < 0.01f) { scrollerState = UIElementState.Active; } break; default: break; } for (int i = 0; i < scrollableItems.Count; i++) { float angle = scrollValue - i * step; float x = radius * Mathf.Sin(angle); float y = radius * Mathf.Cos(angle); cvs[i].alpha = (y - (1 - alpharange) * radius) / (alpharange * radius); scrollableItems[i].localPosition = new Vector3(0, x, y); scrollableItems[i].transform.localRotation = Quaternion.Euler(Mathf.Sign(x) * cvs[i].alpha * angleShift, 0, 180);//Quaternion.AngleAxis( Mathf.Sign(x)*cvs[i].alpha*angleShift,Vector3.right); } }