FullScreenTextController.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. using UnityEngine;
  2. namespace GFGGame
  3. {
  4. public class FullScreenTextController
  5. {
  6. public const string RESIN_TXT_DIR_PATH = "Assets/ResIn/Txt";
  7. public static string GetTxtPath(string res, string extName = "txt")
  8. {
  9. return $"{RESIN_TXT_DIR_PATH}/{res}.{extName}";
  10. }
  11. public static void Show(string eventName)
  12. {
  13. string content = null;
  14. switch (eventName)
  15. {
  16. case "event:a":
  17. content = GFGAsset.Load<TextAsset>(GetTxtPath("serviceProtocal")).text;
  18. break;
  19. case "event:b":
  20. content = GFGAsset.Load<TextAsset>(GetTxtPath("privacyPolicy")).text;
  21. break;
  22. case "event:c":
  23. content = GFGAsset.Load<TextAsset>(GetTxtPath("privacyPolicyChildren")).text;
  24. break;
  25. }
  26. if (!string.IsNullOrEmpty(content))
  27. {
  28. FullScreenTextView.Instance.Show(content);
  29. }
  30. }
  31. }
  32. }