1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- /// <summary>
- /// 语音指令
- /// </summary>
- public enum Voice
- {
- /// <summary>
- /// 全局
- /// </summary>
- Global,
- /// <summary>
- /// 临境
- /// </summary>
- Immersed,
- /// <summary>
- /// 协同
- /// </summary>
- Synergy,
- NullVoice =-1
- }
- public class TestVoice : MonoBehaviour
- {
- /// <summary>
- /// 设置当前模式
- /// </summary>
- /// <param name="voice"> 语音指令</param>
- public void SettingVoice(int recognition)
- {
- Voice voice = Voice.NullVoice;
- switch (recognition)
- {
- case 2:
- voice = Voice.Immersed;
- break;
- case 3:
- voice = Voice.Synergy;
- break;
- case 4:
- voice = Voice.NullVoice;
- break;
- case 1:
- case 5:
- case 6:
- voice = Voice.Global;
- break;
- default:
- break;
- }
- switch (voice)
- {
- case Voice.Global:
- GameManager.instacne.UserClick("OpenScence3");
- break;
- case Voice.Immersed:
- GameManager.instacne.UserClick("OpenScence4");
- break;
- case Voice.Synergy:
- GameManager.instacne.UserClick("OpenScence5");
- break;
- case Voice.NullVoice:
- Debug.Log(" Invalid Voice ");
- break;
- default:
- break;
- }
- }
- }
|