Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5.  
  6. public class TwoForLoops : MonoBehaviour {
  7.  
  8. static int i,j;
  9.  
  10. // Use this for initialization
  11. void Start () {
  12. var object0 = new GameObject ("object" + 0);
  13. }
  14.  
  15. // Update is called once per frame
  16. void Update () {
  17. if (Input.GetKeyDown (KeyCode.T)) {
  18. for (i =1;i<=10; i++) {
  19. var objecti = new GameObject ("object" + i);
  20. print ("Created object " + i);
  21.  
  22.  
  23. for (j=10;j>=5; j--) {
  24. Destroy (objectj);
  25. print ("Destroyed object " + j);
  26. }
  27. }
  28.  
  29. print ("-------------------------");
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement