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 Array : MonoBehaviour
- {
- private int[] intArray = new int[5];
- private void Start()
- {
- for (int i = 0; i < intArray.Length; i++)
- {
- intArray[i] = i + 1;
- }
- int j = 0;
- while (j < intArray.Length)
- {
- intArray[j] = j + 1;
- j = j + 1;
- }
- foreach (int i in intArray)
- {
- intArray[i - 1] = i;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement