This commit is contained in:
zhangzheng
2026-03-25 16:58:26 +08:00
parent 3a9813675e
commit 2c230960db
22 changed files with 517 additions and 232 deletions

View File

@@ -2,12 +2,11 @@ using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Stary.Evo;
using Rokid.UXR.Module;
using UnityEngine.Android;
namespace Stary.Evo.RKTools
{
#if Evo_Rokid
public class VoiceCommandController : MonoBehaviour
{
public Dictionary<string, Action> VoiceCommands = new Dictionary<string, Action>();
@@ -39,8 +38,8 @@ namespace Stary.Evo.RKTools
Permission.RequestUserPermission("android.permission.RECORD_AUDIO");
}
ModuleManager.Instance.RegistModule("com.rokid.voicecommand.VoiceCommandHelper", false);
OfflineVoiceModule.Instance.ChangeVoiceCommandLanguage(LANGUAGE.CHINESE);
Rokid.UXR.Module.ModuleManager.Instance.RegistModule("com.rokid.voicecommand.VoiceCommandHelper", false);
Rokid.UXR.Module.OfflineVoiceModule.Instance.ChangeVoiceCommandLanguage(Rokid.UXR.Module.LANGUAGE.CHINESE);
isInit = true;
}
@@ -54,9 +53,9 @@ namespace Stary.Evo.RKTools
return;
}
OfflineVoiceModule.Instance.AddInstruct(LANGUAGE.CHINESE, content, spell, this.gameObject.name,
Rokid.UXR.Module.OfflineVoiceModule.Instance.AddInstruct(Rokid.UXR.Module.LANGUAGE.CHINESE, content, spell, this.gameObject.name,
"OnReceive");
OfflineVoiceModule.Instance.Commit();
Rokid.UXR.Module.OfflineVoiceModule.Instance.Commit();
}
/// <summary>
@@ -81,8 +80,8 @@ namespace Stary.Evo.RKTools
public void ClearAllVoiceCommand()
{
VoiceCommands.Clear();
OfflineVoiceModule.Instance.ClearAllInstruct();
OfflineVoiceModule.Instance.Commit();
Rokid.UXR.Module.OfflineVoiceModule.Instance.ClearAllInstruct();
Rokid.UXR.Module.OfflineVoiceModule.Instance.Commit();
}
void OnReceive(string msg)
@@ -94,4 +93,6 @@ namespace Stary.Evo.RKTools
}
}
#endif
}