Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Array : MonoBehaviour
  6. {
  7. private int[] intArray = new int[5];
  8. private int randomNumber;
  9. private int MaxValue = 10;
  10. private int currentValue;
  11. private void Start()
  12. {
  13. for (int i = 0; i < intArray.Length; i++)
  14. {
  15. randomNumber = Random.Range(0, 10);
  16. intArray[i] = randomNumber;
  17. currentValue = intArray[i];
  18.  
  19. if (currentValue < MaxValue)
  20. {
  21. MaxValue = currentValue;
  22. }
  23. }
  24. Debug.Log(MaxValue);
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement