Created
November 12, 2018 21:01
-
-
Save Templar2020/74b759598adc504f44af90a2d51db5a8 to your computer and use it in GitHub Desktop.
Arrays, Lists, ListArrays, Dictionary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class Arrays : MonoBehaviour { | |
public string[] familyMembers = new string[]{"Dharma","Greg","Zen","Karma","Serenity"}; | |
public int[] numbers; | |
void Start(){ | |
numbers[0] = 1; | |
numbers[1] = 2; | |
numbers[2] = 3; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class Lists : MonoBehaviour { | |
public ArrayLists inventory = new ArrayList(); | |
void Start(){ | |
inventory.Add("Fish"); | |
inventory.Add(10); | |
inventory.Add(GameObject.Find("Player"); | |
inventory.Add("Sword"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class Lists : MonoBehaviour { | |
public Hashtable friends = new Hashtable(); | |
void Start(){ | |
friends.Add("firstName", "Fish"); | |
Debug.Log((string)personalDetails["firstName"]); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class Lists : MonoBehaviour { | |
public List<string> familyMembers = new List<string>(); | |
void Start(){ | |
familyMembers.Add("Bob"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment