Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (IsVoiceOverOn.isVoiceOverOn())
     {
         am.check();
     }
 }
Esempio n. 2
0
    private void isComponetEnabled(Component component, bool interactable)
    {
        Selectable selectable = component.GetComponentInChildren <Selectable>();

        if (selectable != null)
        {
            selectable.interactable = interactable;
            Text text = component.GetComponentInChildren <Text>();
            if (text.text == "Go Back")
            {
                if (IsVoiceOverOn.isVoiceOverOn() && interactable)
                {
                    border.enabled = true;
                }
                else
                {
                    border.enabled = false;
                }
                border.transform.SetParent(text.transform, false);
                border.rectTransform.sizeDelta = new Vector2(20, 20);
            }
        }
        else
        {
            border.enabled = interactable;
            if (interactable)
            {
                border.transform.SetParent(component.transform, false);
                border.rectTransform.sizeDelta = new Vector2(20, 20);
            }
        }
    }
Esempio n. 3
0
    private IEnumerator run(NarratableObject[] sceneObjects)
    {
        while (!IsVoiceOverOn.isVoiceOverOn())
        {
            yield return(null);
        }

        disableSceneComponents(sceneObjects);
        while (true)
        {
            if (!IsVoiceOverOn.isVoiceOverOn())
            {
                enableSceneComponents(sceneObjects);
            }

            while (!IsVoiceOverOn.isVoiceOverOn())
            {
                yield return(null);
            }

            int currentIndex = 0;
            while (currentIndex < sceneObjects.Length)
            {
                if (!IsVoiceOverOn.isVoiceOverOn())
                {
                    break;
                }
                else
                {
                    disableSceneComponents(sceneObjects);
                }

                NarratableObject narratableObject = sceneObjects[currentIndex];

                currentComponent = narratableObject.component;
                float waitTime = narratableObject.waitTime;

                Text description = currentComponent.GetComponentInChildren <Text>();

                enableComponent(narratableObject.component);

                if (description != null)
                {
                    EasyTTSUtil.SpeechAdd(description.text, VOLUME, RATE, PITCH);
                }
                else
                {
                    Debug.Log("Accessibility Mode given an object with no text.");
                }

                float t = 0.0f;
                while (t <= waitTime && (!swipeLeft && !swipeRight) && IsVoiceOverOn.isVoiceOverOn())
                {
                    t += Time.deltaTime;
                    yield return(null);
                }

                if (loop || (swipeLeft || swipeRight) || !IsVoiceOverOn.isVoiceOverOn())
                {
                    disableComponent(narratableObject.component);
                }

                currentIndex = updateIndex(currentIndex, sceneObjects.Length);
            }
        }
    }