Answers for "unity []"

C#
7

unity array c#

string[ ] familyMembers = new string[]{"John", "Amanda", "Chris", "Amber"} ; 
 
string[ ] carsInTheGarage = new string[] {"VWPassat", "BMW"} ; 
 
int[ ] doorNumbersOnMyStreet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; 
 
GameObject[ ] carsInTheScene = GameObject.FindGameObjectsWithTag("car");
Posted by: Guest on April-12-2020
1

unity functinos in array

// Modified version of: https://answers.unity.com/questions/873650/how-to-make-a-list-or-array-of-functions-with-type.html
	// Modified By Malte0621
	delegate void FuncsMethod();
    void CreateList()
    {
        List<FuncsMethod> funcs = new List<FuncsMethod>();
        // Add Functions ...
        funcs.Add(function1);
        funcs.Add(function2);
        // Call Function ...
        funcs[0]();
    }
    // Functions
    void function1()
    {
        Debug.Log("Function 1 called.");
    }
    void function2()
    {
        Debug.Log("Function 2 called.");
    }
Posted by: Guest on December-27-2020
1

unity array c#

public string[] myArrayName = new string[4];
Posted by: Guest on April-12-2020

C# Answers by Framework

Browse Popular Code Answers by Language