Skip to content

Instantly share code, notes, and snippets.

@leventeren
Created September 5, 2020 22:06
Show Gist options
  • Save leventeren/bead295204065b5ddb60ffc4ddbe2a42 to your computer and use it in GitHub Desktop.
Save leventeren/bead295204065b5ddb60ffc4ddbe2a42 to your computer and use it in GitHub Desktop.
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;
}
}
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");
}
}
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"]);
}
}
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