using UnityEngine; using System.Collections.Generic; public static class DictionaryExtensions { /// /// When DEBUG compiler directive is enabled, we will have more meaningful logs if the key doesn't exist /// public static L GetValueForKey( this Dictionary dict, T key) { #if DEBUG if (dict.ContainsKey(key)) { return dict[key]; } else { AVDebug.LogError("Key "+key+ " was not found in dictionary"); return default(L); } #else return dict[key]; #endif } }