Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Experiments : MonoBehaviour
  6. {
  7.     private static Dictionary<string, string> _dict1 = new Dictionary<string, string>();
  8.  
  9.     void Start()
  10.     {
  11.         TestDict();
  12.         DictResult();
  13.     }
  14.  
  15.     void TestDict()
  16.     {
  17.         Dictionary<string, string> newDict = new Dictionary<string, string>();
  18.         newDict = _dict1;
  19.         newDict.Add("String1", "string1 Val");
  20.     }
  21.  
  22.     void DictResult()
  23.     {
  24.         Debug.Log("Output keys");
  25.         foreach(string key in _dict1.Keys)
  26.         {
  27.             Debug.Log(key + ": " + _dict1[key]);
  28.         }
  29.         Debug.Log("End keys");
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement