DebugLanguageSwitcher.cs 526 B

123456789101112131415161718192021222324252627282930
  1. using UnityEngine;
  2. using System.Collections;
  3. public class DebugLanguageSwitcher : MonoBehaviour
  4. {
  5. void Start()
  6. {
  7. DebugViewManager.OnDebugView += OnDebugView;
  8. }
  9. void OnDestroy()
  10. {
  11. DebugViewManager.OnDebugView -= OnDebugView;
  12. }
  13. void OnDebugView()
  14. {
  15. GUILayout.BeginHorizontal();
  16. if (GUILayout.Button("English"))
  17. {
  18. Localization.instance.currentLanguage = "English";
  19. }
  20. if (GUILayout.Button("Icelandic"))
  21. {
  22. Localization.instance.currentLanguage = "Icelandic";
  23. }
  24. GUILayout.EndHorizontal();
  25. }
  26. }