GameOverUI.cs 843 B

123456789101112131415161718192021222324252627282930313233
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class GameOverUI : MonoBehaviour
  5. {
  6. public GameObject[] ScoreObj;
  7. public GameObject[] ShotObj;
  8. public GameObject[] HitObj;
  9. public GameObject[] HitRateObj;
  10. // Start is called before the first frame update
  11. void Start()
  12. {
  13. int index = (int)TextAutoLanguage2.GetLanguage(); //== LanguageEnum.Chinese;
  14. SetLanguageObjects(ScoreObj, index);
  15. SetLanguageObjects(ShotObj, index);
  16. SetLanguageObjects(HitObj, index);
  17. SetLanguageObjects(HitRateObj, index);
  18. }
  19. private void SetLanguageObjects(GameObject[] objects, int index)
  20. {
  21. if (objects == null) return;
  22. for (int i = 0; i < objects.Length; i++)
  23. {
  24. objects[i].SetActive(index == i);
  25. }
  26. }
  27. }