how to #define array in C code example
Example 1: How to make a array in c#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Array : MonoBehaviour
{
public GameObject[] MyObjects;
void Update()
{
for (int i = 0; i < MyObjects.Length; i++)
{
Destroy(MyObjects[i], 3f);
}
}
}
Example 2: how to make a c# array
datatype_variable[dimension] = new datatype[size]{array};
string MyArray[] = new string[1]{"Hello","World"};
string MyArray[]={"Hello","world"};
int MyArray=[,]=new int[1,2]{
{1,2,3},
{1,2,3}
}
int MyArray=[,,]=new int[1,2,3]{
{
{1,2,3,4},
{1,2,3,4},
{1,2,3,4}
},
{
{1,2,3,4},
{1,2,3,4},
{1,2,3,4}
}
}