Beispiel #1
0
        /// <summary>
        /// エクスプレッションの設定
        /// </summary>
        /// <param name="ExpressionCode"></param>
        public IEnumerator SetExpression(MOTION ExpressionCode)
        {
            //対照感情のモーション取得
            string motionName = GetMotionNameTargetMotionRndam(ExpressionCode);

            //取得モーションがNULLでなければ実行する。
            if (motionName != null)
            {
                //モーション実行
                Animator.Play(motionName);
                Animator.Blend(GetExpressionNameTargetMotionRndam(ExpressionCode));

                //モーション完了待ち
                yield return(new WaitForSeconds(Animator.GetClip(motionName).length));

                //パラメーター初期化
                //InitParamator();

                //表情とアイドル設定
                Animator.Blend(GetMotionNameTargetIdleMotionRndam());
            }
            else
            {
                //様子見中
                //一旦停止
                //Animator.Stop();

                //パラメーター初期化
                //InitParamator();

                //表情とアイドル設定
                Animator.Play(GetExpressionNameTargetMotionRndam(ExpressionCode));
                Animator.Blend(GetMotionNameTargetIdleMotionRndam());
            }
        }