T01.cs 695 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. namespace LearnStorage
  6. {
  7. /// <summary>
  8. ///
  9. /// </summary>
  10. public class T01 : MonoBehaviour
  11. {
  12. private Text debugTCmpt;
  13. private void Start()
  14. {
  15. debugTCmpt = GameObject.Find("Text").GetComponent<Text>();
  16. Draw(10);
  17. }
  18. private void Draw(int level)
  19. {
  20. for (int i = 0; i < level; i++)
  21. {
  22. for (int j = 0; j < i; j++)
  23. {
  24. debugTCmpt.text += "0";
  25. }
  26. for (int j = 0; j < level - i; j++)
  27. {
  28. debugTCmpt.text += "#";
  29. }
  30. debugTCmpt.text += "\n";
  31. }
  32. return;
  33. }
  34. }
  35. }