VoiceEvents.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the license found in the
  6. * LICENSE file in the root directory of this source tree.
  7. */
  8. using System;
  9. using UnityEngine;
  10. using UnityEngine.Serialization;
  11. namespace Meta.WitAi.Events
  12. {
  13. [Serializable]
  14. public class VoiceEvents : SpeechEvents
  15. {
  16. private const string EVENT_CATEGORY_DATA_EVENTS = "Data Events";
  17. [EventCategory(EVENT_CATEGORY_DATA_EVENTS)]
  18. [FormerlySerializedAs("OnByteDataReady")] [SerializeField] [HideInInspector]
  19. private WitByteDataEvent _onByteDataReady = new WitByteDataEvent();
  20. public WitByteDataEvent OnByteDataReady => _onByteDataReady;
  21. [EventCategory(EVENT_CATEGORY_DATA_EVENTS)]
  22. [FormerlySerializedAs("OnByteDataSent")] [SerializeField] [HideInInspector]
  23. private WitByteDataEvent _onByteDataSent = new WitByteDataEvent();
  24. public WitByteDataEvent OnByteDataSent => _onByteDataSent;
  25. [EventCategory(EVENT_CATEGORY_ACTIVATION_RESPONSE)]
  26. [Tooltip("Called after an on partial response to validate data. If data.validResponse is true, service will deactivate & use the partial data as final")]
  27. [FormerlySerializedAs("OnValidatePartialResponse")] [SerializeField]
  28. private WitValidationEvent _onValidatePartialResponse = new WitValidationEvent();
  29. public WitValidationEvent OnValidatePartialResponse => _onValidatePartialResponse;
  30. }
  31. }