make new array in c#
string[] stringArray = new string[6];
make new array in c#
string[] stringArray = new string[6];
How to make a array in c#
//use this for unity editor:
using UnityEngine;
public class MyScript : MonoBehaviour {
//You can change the variable type to int, float, strings and others
//Note: You need to asign the objects from the unity editor or the script
public GameObject[] MyObjects;/*edit the size of the array in the unity editor
or add = new GameObject[the length of the array]*/
void Update(){
//Here we are using for loop to destroy our objects in the list
for (int i = 0; i < MyObjects.Length; i++){
Destroy(MyObjects[i], 3.0f);/*The second parameter is how much seconds to wait
before the certain object will be destroyed*/
}
}
}
//Sry for my english its bad
array in C#
// String array for my friends ( Example )
string[] myFriends = {"Friend1", "Friend2", "Friend3", "Friend4"};
// Display MyFriend2 at index of ( 1 )
Console.WriteLine(myFriends[1]);
c# define array
float[] floats = new float[]{1.0,1.1,1.4,1.23,2212.233};
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us