Compliance.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*******************************************************************************
  2. Copyright © 2015-2022 PICO Technology Co., Ltd.All rights reserved.
  3. NOTICE:All information contained herein is, and remains the property of
  4. PICO Technology Co., Ltd. The intellectual and technical concepts
  5. contained herein are proprietary to PICO Technology Co., Ltd. and may be
  6. covered by patents, patents in process, and are protected by trade secret or
  7. copyright law. Dissemination of this information or reproduction of this
  8. material is strictly forbidden unless prior written permission is obtained from
  9. PICO Technology Co., Ltd.
  10. *******************************************************************************/
  11. using Pico.Platform.Models;
  12. using UnityEngine;
  13. namespace Pico.Platform
  14. {
  15. /**
  16. * \ingroup Platform
  17. * Application or games need comply with the laws where they distributes. So developers
  18. * should take compliance into consideration. This module provides some useful methods
  19. * to implement compliance.
  20. */
  21. public static class ComplianceService
  22. {
  23. /// <summary>
  24. /// Detects sensitive words in texts.
  25. /// </summary>
  26. /// <param name="scene">Indicates where the text appears. For example, the text can appear in a username, room name, in-room chat, etc.</param>
  27. /// <param name="content">The text to check, which can be a username, room-chat message, etc.</param>
  28. /// <returns>
  29. /// Whether the text contains sensitive words. If it contains, the app should not allow
  30. /// the user to publish the text and can take the strategy proposed by the
  31. /// result.
  32. /// </returns>
  33. public static Task<DetectSensitiveResult> DetectSensitive(DetectSensitiveScene scene, string content)
  34. {
  35. if (!CoreService.Initialized)
  36. {
  37. Debug.LogError(CoreService.NotInitializedError);
  38. return null;
  39. }
  40. return new Task<DetectSensitiveResult>(CLIB.ppf_Compliance_DetectSensitive(scene, content));
  41. }
  42. }
  43. }
粤ICP备19079148号