Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity string array

// String array in Unity C#
string[] names = new string[] {"red", "green", "blue"};

// To use lists, make sure to have this at the beginning of your program
using System.Collections.Generic;

// To declare a new list
public List<string> listOfColours = new List<string>();

// To add elements to your list
void Start()
{
	listOfColours.Add("Red");
    listOfColours.Add("Green");
    listOfColours.Add("Blue");
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: csharp get integer part of number 
Csharp :: defaultconnection appsettings.json 
Csharp :: radians to degree c# 
Csharp :: how to populate listbox using list<t c# 
Csharp :: how to split and get last index values in c# 
Csharp :: unity smooth camera 2d 
Csharp :: unity object follow mouse 
Csharp :: unity how to load up a scene 
Csharp :: c# kill all processes by name 
Csharp :: custom editor unity 
Csharp :: wpf label text color rgb string 
Csharp :: how to start a coroutine in c# 
Csharp :: how to check if list index is out of range in c# 
Csharp :: c# add item to a lsit 
Csharp :: unity get direction from one point to another 
Csharp :: minheap c# 
Csharp :: shutdown system c# 
Csharp :: add items to listbox from text file c# 
Csharp :: unity check if audio playing 
Csharp :: .NET Microsoft.dotnet-httprepl 
Csharp :: how to draw a rectangle in monogame 
Csharp :: c# générer un nombre aléatoire 
Csharp :: if string contains number c# 
Csharp :: unity animator current state name 
Csharp :: how to do fizzbuzz in c# 
Csharp :: dictionary c# 
Csharp :: unity lock cursor to center 
Csharp :: unity c# delay function 
Csharp :: unity check load scene 
Csharp :: string length c# 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =