public void Update() { switch (curState) { case TrackingState.Waiting: { timer += Time.deltaTime; if (timer > resetDuration) { Animator[] myAnimatorContainer = VuMark.GetComponentsInChildren <Animator>(); for (int i = 0; i < myAnimatorContainer.Length; i++) { myAnimatorContainer[i].SetBool("shouldPlay", false); myAnimatorContainer[i].SetTrigger("shouldGoBack"); myAnimatorContainer[i].SetBool("shouldMove", false); myAnimatorContainer[i].SetTrigger("shouldGoDefault"); } ToggleArrows(false); myTabsManagerRef.Close(); curState = TrackingState.Lost; } break; } default: break; } }
public void EnableObjects(GameObject gameObjectToPass) { detectedGameObject = gameObjectToPass; myTabsManagerRef = detectedGameObject.GetComponentInChildren <TabsManager>(true); var rendererComponents = gameObjectToPass.GetComponentsInChildren <Renderer>(true); var colliderComponents = gameObjectToPass.GetComponentsInChildren <Collider>(true); var canvasComponents = gameObjectToPass.GetComponentsInChildren <Canvas>(true); var depthMaskComponent = depthMask.GetComponent <Renderer>(); foreach (var component in rendererComponents) { component.shadowCastingMode = ShadowCastingMode.Off; component.enabled = true; if (component.gameObject.tag == "VirtualButton") { component.enabled = false; } } foreach (var component in colliderComponents) { component.enabled = true; } foreach (var component in canvasComponents) { component.enabled = true; } depthMaskComponent.enabled = true; Animator[] myAnimatorContainer = gameObjectToPass.GetComponentsInChildren <Animator>(); //if(curState!=TrackingState.Waiting) { Debug.Log(myAnimatorContainer.Length); for (int i = 0; i < myAnimatorContainer.Length; i++) { myAnimatorContainer[i].SetBool("shouldMove", true); } } if (curState == TrackingState.Waiting) { for (int i = 0; i < myAnimatorContainer.Length; i++) { myAnimatorContainer[i].SetTrigger("Skip"); } ToggleArrows(true); } ResetTracking(); if (messenger != null) { messenger.HideMessage(); } if (detectedGameObject != previousGameObject) { previousTabsManager.Close(); } }