private void Initialize()
        {
            m_AudioSource             = GetComponent <AudioSource>();
            m_AudioSource.playOnAwake = false;
            m_AudioSource.loop        = false;

            m_GoogleCloudTTS = GetComponent <GoogleCloud.GoogleCloudTTS>();

            try
            {
                m_TextToSpeechJavaClass = new AndroidJavaClass(Pocketboy.SpeechPlugin.SpeechPlugin.PACKAGE_NAME + "." + Pocketboy.SpeechPlugin.SpeechPlugin.TEXT_TO_SPEECH_CLASS);
                m_TextToSpeechJavaClass.CallStatic("setPitch", 1f);
                m_TextToSpeechJavaClass.CallStatic("setSpeed", 1f);
                m_RoboyController = GetComponent <RoboyManager>();
            }
            catch (Exception e)
            {
                Debug.LogError(e);
                m_Initialized = false;
                return;
            }

            if (m_RoboyController == null)
            {
                Debug.LogError("Could not find <RoboyController>.");
                m_Initialized = false;
            }
            else
            {
                m_Initialized = true;
            }
        }
        private void Initialize()
        {
            try
            {
                m_SpeechToTextJavaClass = new AndroidJavaClass(Pocketboy.SpeechPlugin.SpeechPlugin.PACKAGE_NAME + "." + Pocketboy.SpeechPlugin.SpeechPlugin.SPEECH_TO_TEXT_CLASS);
                m_SpeechToTextJavaClass.CallStatic("setDelimiter", m_Delimiter);
                ListenButton.onClick.AddListener(HandleListening);
                m_InitColor    = ListenButton.image.color;
                m_RoboyManager = RoboyManager.Instance;
            }
            catch (Exception e)
            {
                Debug.LogError(e);
                m_Initialized = false;
                return;
            }

            if (m_RoboyManager == null)
            {
                Debug.LogError("Could not find <RoboyManager>.");
                m_Initialized = false;
            }
            else
            {
                m_Initialized = true;
            }
        }
Exemplo n.º 3
0
        private void SpawnRoboy()
        {
            if (RoboyManager.InstanceExists)
            {
                return;
            }

            var plane  = ARSessionManager.Instance.FloorPlane;
            var anchor = plane.CreateAnchor(plane.CenterPose);

            TemporaryAnchor.Create(anchor, true);
            m_Roboy = Instantiate(RoboyPrefab, plane.CenterPose.position, plane.CenterPose.rotation);
            m_Roboy.transform.parent = anchor.transform;
            m_Roboy.Initialize(anchor);
            var face = Instantiate(UnityFacePrefab);

            face.gameObject.transform.SetParent(m_Roboy.ARAnchor.transform);
            SpawnPlanetSystems();
        }