Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class TwoForLoops : MonoBehaviour {
- static int i,j;
- // Use this for initialization
- void Start () {
- var object0 = new GameObject ("object" + 0);
- }
- // Update is called once per frame
- void Update () {
- if (Input.GetKeyDown (KeyCode.T)) {
- for (i =1;i<=10; i++) {
- var objecti = new GameObject ("object" + i);
- print ("Created object " + i);
- for (j=10;j>=5; j--) {
- Destroy (objectj);
- print ("Destroyed object " + j);
- }
- }
- print ("-------------------------");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement