Example #1
0
        void Start()
        {
            SpeechRecognizer.CallbackGameObjectName = gameObject.name;
            SpeechRecognizer.RequestRecognizerAuthorization();

            //音源割り当て
            AudioSource[] voices = gameObject.GetComponents <AudioSource>();
            ganbatterune    = voices[0];
            itterassyai     = voices[1];
            matatsukaretara = voices[2];
            ohayo           = voices[3];
            okite           = voices[4];
            okiteyo         = voices[5];
            oyasumi         = voices[6];
            sugoine         = voices[7];
            tsuchidayo      = voices[8];

            //アニメーションフラグ初期化
            anim = GetComponent <Animator>();
            anim.SetBool("ganbatterune", false);
            anim.SetBool("ohayo", false);
            anim.SetBool("okite", false);
            anim.SetBool("okiteyo", false);
            anim.SetBool("itterassyai", false);
            anim.SetBool("oyasumi", false);
            anim.SetBool("sugoine", false);
            anim.SetBool("tsuchidayo", false);

            //瞬き
            faceM     = GameObject.Find("face");
            facemoof  = faceM.GetComponent <SkinnedMeshRenderer>();
            eye_blink = 0;

            StartRecord();

            //slack初期化
            StartCoroutine(slackNotifier.GetNotification());
            slackNotifier.SetBool(false);
            timeleft = 5.0f;

            dir.x = 0;
            dir.y = 0;
            dir.z = 1;

            dir_old.x = 0;
            dir_old.y = 0;
            dir_old.z = 1;

            getUp      = false;
            notifiFlag = false;

            //起きて
            okiteCnt   = 0;
            okiteyoCnt = 0;
            okiteLim   = 2;
            okiteyoLim = 4;
        }
 void Start()
 {
     SpeechRecognizer.CallbackGameObjectName = gameObject.name;
     SpeechRecognizer.RequestRecognizerAuthorization();
     ui.UpdateButton("Requesting authorization", false);
 }