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); } }
/// <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); }
/// <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); }
public void Set(string value) { SetValue(value); StringCallback?.Invoke(value); Save(); }