Inheritance: TwilioController
Exemple #1
0
 private void ShowAndAddButtonEvent()
 {
     this.Black = this.mRoot.transform.Find("sp_mask").gameObject;
     this.EventButtonTempParent = EventButton.transform.parent;
     EventButton.transform.SetParent(this.Black.transform);
     if (this.data.BtnPos != null && this.data.BtnPos != Vector3.zero)
     {
         EventButton.transform.localPosition = this.data.BtnPos;
         EventButton.transform.localScale    = Vector3.one;
     }
     if (!string.IsNullOrEmpty(this.data.ShowView))
     {
         this.ShowView = this.EventButtonTempParent.Find(this.data.ShowView).gameObject;
         if (this.ShowView != null)
         {
             this.ShowView.transform.SetParent(this.Black.transform);
             if (this.data.ShowViewPos != null && this.data.ShowViewPos != Vector3.zero)
             {
                 this.ShowView.transform.localPosition = this.data.ShowViewPos;
                 this.ShowView.transform.localScale    = Vector3.one;
             }
         }
     }
     if (!this.Black.activeSelf)
     {
         this.Black.SetActive(true);
     }
     if (data != null)
     {
         if (data.BtnTriggerType == (int)EButtonTriggerType.Click)
         {
             Selectable click = null;
             if (EventButton != null)
             {
                 click = EventButton.GetComponent <Button>();
                 if (click != null)
                 {
                     (click as Button).onClick.AddListener(this.OnClick);
                 }
                 else
                 {
                     click = EventButton.GetComponent <Toggle>();
                     if (click != null)
                     {
                         (click as Toggle).onValueChanged.AddListener(this.OnSelect);
                     }
                     else
                     {
                         controller = EventButton.GetComponent <VoiceController>();
                         if (controller != null)
                         {
                             controller.onClickDown += this.OnClickDown;
                             controller.onClickUp   += this.OnClickUp;
                         }
                     }
                 }
             }
         }
     }
 }
 public void InitPluin()
 {
     voiceController = GetComponent <VoiceController>();
     // voiceController = new VoiceController();
     myResponse = null;
     voiceController.InitPlugin();
 }
Exemple #3
0
        public void TestSuccessfulWithoutAddons()
        {
            var controller = new VoiceController();
            var result     = controller.Index(new VoiceRequest(), null);

            Assert.IsFalse(result.Data.ToString().Contains("<Reject"));
        }
Exemple #4
0
    private void MatchVoiceCheckItem(string item, string content)
    {
        if (content == item)
        {
            VoiceController.CreateVoiceStar();
            LogManager.Log("讯飞获得:", content, ", 匹配单词:", item);
            m_Status = TutorialStatus.Nothing;
            XunFeiSRManager.Instance.StopListen();
            MicManager.Instance.StopRecord();
            AudioObject obj = null;
            if (LanguageManager.languageType == LanguageType.Chinese)
            {
                obj = AudioController.Play("Recording_3");
            }
            else
            {
                obj = AudioController.Play("en_Recording8");
            }
            AnalysisManager.Instance.OnEvent("100005", null, "新手", "完成新手");
            obj.completelyPlayedDelegate = Skip;

            return;
        }
        else
        {
            LogManager.Log("讯飞获得:", content, ", 匹配单词:", item);
            return;
        }
    }
	public void CheckCreateMissle()
	{
		if (m_GetVoice && !m_CreateMissle)
		{
			m_CreateMissle = true;
			VoiceController.OnBossSentenceComplete();
		}
	}
Exemple #6
0
 // Start is called before the first frame update
 void Start()
 {
     vc = GameObject.Find("Player").GetComponent <VoiceController>();
     pc = GameObject.Find("pot").GetComponent <PotController>();
     gc = GameObject.Find("FireGuide").GetComponent <GudieController>();
     cong.SetActive(false);
     btn1.SetActive(false);
 }
Exemple #7
0
        public void TestSuccessfulWithNomoRoboApiFailure()
        {
            var addOns     = File.ReadAllText("failed_nomorobo.json");
            var controller = new VoiceController();
            var result     = controller.Index(new VoiceRequest(), addOns);

            Assert.IsFalse(result.Data.ToString().Contains("<Reject"));
        }
Exemple #8
0
        public void TestBlockedWithWhitePages()
        {
            var addOns     = File.ReadAllText("spam_whitepages.json");
            var controller = new VoiceController();
            var result     = controller.Index(new VoiceRequest(), addOns);

            Assert.IsTrue(result.Data.ToString().Contains("<Reject"));
        }
Exemple #9
0
        public void TestSuccessfulWithMarchex()
        {
            var addOns     = File.ReadAllText("successful_marchex.json");
            var controller = new VoiceController();
            var result     = controller.Index(new VoiceRequest(), addOns);

            Assert.IsFalse(result.Data.ToString().Contains("<Reject"));
        }
 void Start()
 {
     Instance = this;
     DontDestroyOnLoad(gameObject);
     voice       = Chagall.GetComponent <VoiceController>();
     timeline    = Chagall.GetComponent <PlayableDirector>();
     GameStarted = false;
 }
	private void SilentCallback()
	{
		//LogManager.Log("silent callback");
		if (!m_CreateMissle)
		{
			m_CreateMissle = true;
			VoiceController.OnBossSentenceComplete();
		}
	}
Exemple #12
0
    // Start is called before the first frame update
    void Start()
    {
        GC = FindObjectOfType(typeof(GameController)) as GameController;
        VC = FindObjectOfType(typeof(VoiceController)) as VoiceController;
        DM = FindObjectOfType(typeof(DialogueManager)) as DialogueManager;

        SpawnPowerUp = GameObject.Find("SpawnPowerUp").transform;

        Cima     = GameObject.Find("Cima").transform;
        Esquerda = GameObject.Find("Esquerda").transform;
        Direita  = GameObject.Find("Direita").transform;
        Baixo    = GameObject.Find("Baixo").transform;

        playerRigidbody = GetComponent <Rigidbody2D>();
        playerAnimator  = GetComponent <Animator>();

        BarraHP            = GameObject.Find("BarraVida").transform;
        BarraHP.localScale = new Vector3(1, 1, 1);

        dashCooldownBar = GameObject.Find("DashCooldownBar");

        joystick      = FindObjectOfType <Joystick>();
        dashJoybutton = GameObject.Find("DashButton");

        HP       = HPMax;
        percVida = HP / HPMax;

        velocidadeXBase = velocidadeX;
        velocidadeYBase = velocidadeY;
        dashTimeBase    = dashTime;

        ArmasRed[powerUpsRedColetados].SetActive(true);
        ArmasBlue[powerUpsBlueColetados].SetActive(true);
        ArmasGreen[powerUpsGreenColetados].SetActive(true);

        VC.PegaArmas();

        Shield.GetComponent <Collider2D>().enabled = false;

        StartCoroutine("Invencibilidade", 1.5f / GameController.instance.GameSpeed);

        Colisores = this.gameObject.GetComponents <Collider2D>();

        switch (PlayerPrefs.GetInt("Skin"))
        {
        case 0:
            playerAnimator.runtimeAnimatorController = Resources.Load <RuntimeAnimatorController>("Controllers/Player/Skin0/PlayerController");
            Colisores[0].enabled = true;
            break;

        case 1:
            playerAnimator.runtimeAnimatorController = Resources.Load <RuntimeAnimatorController>("Controllers/Player/Skin1/PlayerController");
            Colisores[1].enabled = true;
            break;
        }
    }
Exemple #13
0
 void Start()
 {
     img1 = new string[] { "campo", "paisagem", "paisagens", "rural", "campinho", "várzea", "fazenda", "sítio", "chácara",
                           "nuvem", "nuvens", "roça", "plantação", "casa", "casebre", "casinha", "chaminé", "férias", "balanço", "balança",
                           "árvore", "árvores", "arbusto", "arbustos", "cadeira de balanço", "noite", "anoitecer", "grama",
                           "agricultura", "luzes", "banco", "banquinho", "lua", "vila", "vilarejo", "camponês", "campesino",
                           "campensina", "chalé", "brincadeira", "gleba", "terreno", "lavoura", "colheita", "vaca", "gramado",
                           "grama" };
     //img2 = new List<string>();
     progressBar.fillAmount = 0.0f;
     voiceController        = GetComponent <VoiceController>();
 }
Exemple #14
0
    void Start()
    {
        readJson                = GameObject.Find("Selection Manager").GetComponent <ReadJson>();
        functionality           = GameObject.Find("Selection Manager").GetComponent <Functionality>();
        meshCreateControlPoints = GameObject.Find("Selection Manager").GetComponent <MeshCreateControlPoints>();
        treatSelectionManager   = GameObject.Find("Selection Manager").GetComponent <TreatSelectionManager>();
        voiceController         = GameObject.Find("Selection Manager").GetComponent <VoiceController>();

        cam             = GetComponent <Camera>();
        hitMeshCollider = false;
        flagSegment     = -1;
        //meshHand = GameObject.Find("hand").GetComponent<MeshCollider>();
    }
 private void PlayNonRhythmVoice(AudioObject obj = null)
 {
     if (m_CurSentenceIndex == 0 ||
         (m_CurSentenceIndex > 0 && CorePlayData.CurrentSong.NonRhythmSenteces[m_CurSentenceIndex - 1].Type == SentenceType.NonRhythmCommon))
     {
         VoiceController.Show(CreateVoiceSentence);
     }
     else
     {
         CreateVoiceSentence();
     }
     m_Timer = 0;
 }
	// ___  Boss战 "语音"  每句提前结束 
	public void VoiceXunfeiCallback(float accuracy)
	{
		if (!m_CheckFinished)
		{
			m_CheckFinished = true;
			m_GetVoice = true;
			if (!m_CreateMissle)
			{
				m_CreateMissle = true;
				VoiceController.OnBossSentenceComplete();
			}
			m_CurrentSentenceAccuracy = accuracy;
			m_CorePlayBossWar.CalcCurSentence();
		}
	}
Exemple #17
0
        static void Main(string[] args)
        {
            Properties.configure("./local.props");

            port("8080");

            MessageController.listMedia();

            MessageController.listenReplyToMessage();

            VoiceController.letsPlayAGame();
            VoiceController.callMeMessage();
            VoiceController.gatherAndTransfer();

            Console.Read();
        }
Exemple #18
0
    public override void FinishTask()
    {
        this.EventButton.transform.SetParent(this.EventButtonTempParent);
        if (this.ShowView != null)
        {
            this.ShowView.transform.SetParent(this.EventButtonTempParent);
        }
        this.EventButtonTempParent = null;

        if (data.BtnTriggerType == (int)EButtonTriggerType.Click)
        {
            Selectable eventBtn = this.EventButton.GetComponent <Selectable>();
            if (eventBtn != null)
            {
                if (eventBtn is Button)
                {
                    (eventBtn as Button).onClick.RemoveListener(this.OnClick);
                }
                else
                {
                    (eventBtn as Toggle).onValueChanged.RemoveListener(this.OnSelect);
                }
            }
            else
            {
                if (controller != null)
                {
                    controller.onClickDown -= this.OnClick;
                    controller.onClickUp   -= this.OnClickUp;
                    controller.onClickDown  = null;
                    controller.onClickUp    = null;
#if UNITY_ANDROID
                    VoiceManager.Instance.StartSpeech();
#elif UNITY_IOS
                    VoiceManager.Instance.StartSpeech_IOS();
#endif
                    EventDispatch.Broadcast <bool>(Events.DlgTextShowMask, true);
                }
            }
        }
        this.controller = null;
        this.data       = null;
        this.ShowView   = null;
        base.FinishTask();
    }
Exemple #19
0
    private void FlyWord(AudioObject audio = null)
    {
        m_Timer  = 0;
        m_Status = TutorialStatus.CheckSound;

        if (LanguageManager.languageType == LanguageType.Chinese)
        {
            VoiceController.instance.CreateWord("Hello", 5f);
        }
        else
        {
            VoiceController.instance.CreateWord("你好", 5f);
        }

        XunFeiSRManager.Instance.StartListen(GetSRCallback);
        MicManager.Instance.StartRecord(FlyStar, SoundWaveCh);
        VoiceController.Start_RecordingAnim();
    }
 void Awake()
 {
     Debug.Log("[VoiceController:Awake]");
     if (singleton == null)
     {
         Debug.Log("VoiceController checking in.");
         DontDestroyOnLoad(gameObject);
         singleton = this;
         InitializeFields();
     }
     else
     {
         //if anything needs to be re:init, have this call the singleton.
         Debug.Log("VoiceController checking out.");
         GameObject.Destroy(gameObject);
     }
     // _currentMapFileName = defaultMapFileName;
 }
    // Start is called before the first frame update
    public void Start()
    {
#if PLATFORM_ANDROID
        if (!Permission.HasUserAuthorizedPermission(Permission.Microphone))
        {
            Permission.RequestUserPermission(Permission.Microphone);
        }
#endif
        //voiceTest = new VoiceTest();
        voiceC    = this.transform.GetChild(2).gameObject;
        voiceTest = voiceC.GetComponent <VoiceTest>();
        VoiceController voiceController = voiceC.GetComponent <VoiceController>();
        voiceTest.InitPluin();
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        pandaBot            = new pandaAIMLBot();
        pandaBot.Start();
        speechController = new myvoiceController();
        var aSources = GetComponents <AudioSource>();
        userAudioSource                  = aSources[0];
        pandaOutputAudioSource           = aSources[1];
        originalPosition                 = gameObject.transform.position;
        originalRotationValue            = transform.rotation;
        speechController.audioSource     = pandaOutputAudioSource;
        speechController.myHandleTextBox = myHandleTextBox;
        animator = GetComponent <Animator>();
        speechController.animator = animator;
        robotOutput.text          = "Hi, I am panda bot. How can I help you?";
        Debug.Log(robotOutput.text);
        if (voiceTest.isIntialised())
        {
            //StartCoroutine(voiceTest.TTS(robotOutput.text));
            voiceTest.TTS(robotOutput.text);
        }
        else
        {
            StartCoroutine(speechController.sendRequestToRSSAndPlayAudio(robotOutput.text));
        }
        animator.Play("talking");
        animator.Play("waving");
        clipSampleData       = new float[1024];
        userAudioSource.clip = null;
        //Invoke("voiceTest.TTS(robotOutput.text)", 1);
        Idle();
    }
Exemple #22
0
        protected override void OnEnter()
        {
            LogProxy.Info("RoomState: OnEnter");

            _photonClient.CurrentRoom.Messenger.Subscribe((int)ITAlertChannel.Error, ProcessErrorMessage);

            _voiceController = new VoiceController(
                _photonClient,
                _director,
                () => Input.GetKeyDown(KeyCode.Tab) || _talkButton.IsDownFrame,
                () => Input.GetKeyUp(KeyCode.Tab) || _talkButton.IsUpFrame || !Application.isFocused);

            _stateController = _controllerFactory.Create();
            _stateController.Initialize();

            if (!GameExceptionHandler.HasException)
            {
                _stateController.EnterState(LobbyState.StateName);
            }
        }
    void StartReadCurSentence()
    {
        m_Status      = Status.ReadContent;
        m_WrongNumber = 0;
        m_CurGroup    = CorePlayData.CurrentSong.StreamSentences[m_CurrentSentenceIndex];
        if (m_CurrentSentenceIndex > 0 && CorePlayData.CurrentSong.StreamSentences[m_CurrentSentenceIndex - 1].CalckSentence)
        {
            m_SentenceCheckResult = RuntimeConst.BossWarLose;
        }
        m_CurrentBossSentence   = m_CurGroup.GetOneSentence();
        m_CurrentSentenceLength = m_CurGroup.TimeLength * 0.001f * m_MoreTimeParam;
        switch (m_CurGroup.Type)

        {
        case SentenceType.Common:
            CreateSentence();
            //m_BossWarNode.ShowTip();
            //m_TapCreator.ShowWord();
            m_TapCreator.SetClickable();
            PlayAudio();
            break;

        case SentenceType.Voice:
            if (m_CurrentSentenceIndex == 0 ||
                (m_CurrentSentenceIndex > 0 && CorePlayData.CurrentSong.StreamSentences[m_CurrentSentenceIndex - 1].Type == SentenceType.Common))
            {
                //CorePlayManager.Instance.VoiceUIFadeIn(CreateVoice);
                VoiceController.Show(CreateVoice);
            }
            else
            {
                CreateVoice();
            }
            ReadContentFinish(null);
            StaticMonoBehaviour.Instance.StartCoroutine(DelayCheckMissleCreate(m_CurrentSentenceLength - 1));
            break;
        }
    }
 void OnDestroy()
 {
     instance = null;
 }
 void Awake()
 {
     instance = this;
 }
Exemple #26
0
 public void BGFadeOut(Action callback = null)
 {
     VoiceController.Hide(callback);
 }
Exemple #27
0
 public void BGFadeIn(Action callback = null)
 {
     VoiceController.Show(callback);
 }
Exemple #28
0
 public void HighLightWord(List <HitObject> hoList, int index, float preshowLength = 0)
 {
     VoiceController.HighLightWord(hoList, index, preshowLength);
 }
Exemple #29
0
 void Start()
 {
     voiceController = GetComponent <VoiceController>();
 }
Exemple #30
0
 void Start()
 {
     next.SetActive(false);
     voiceController = GetComponent <VoiceController>();
     answer          = guidText.text.Substring(1, guidText.text.Length - 2);
 }