示例#1
0
 public void Init()
 {
     if (Value.GetType() == typeof(string))
     {
         StringCallback?.Invoke(GetString());
     }
     else if (Value.GetType() == typeof(bool))
     {
         BoolCallback?.Invoke((bool)Value);
     }
     else if (Value.GetType() == typeof(int))
     {
         IntCallback?.Invoke((int)Value);
     }
     else if (Value.GetType() == typeof(float))
     {
         FloatCallback?.Invoke((float)Value);
     }
 }
示例#2
0
 /// <summary>
 /// gets called via SendMessage from the android plugin
 /// </summary>
 /// <param name="error">Error.</param>
 public void OnErrorResult(string error)
 {
     Debug.Log(error);
     errorCallback?.Invoke(error);
 }
示例#3
0
 /// <summary>
 /// gets called via SendMessage from the android plugin GameObject must be called "VoiceController"
 /// </summary>
 /// <param name="recognizedText">recognizedText.</param>
 public void OnVoiceResult(string recognizedText)
 {
     Debug.Log(recognizedText);
     resultsCallback?.Invoke(recognizedText);
 }
示例#4
0
 public void Set(string value)
 {
     SetValue(value);
     StringCallback?.Invoke(value);
     Save();
 }