protected Material LoadMaterial(HashID _id) { var _shaderName = _id.ToString(); if (m_Materials.ContainsKey(_id)) { Debug.LogWarningFormat("possible duplicated LoadMaterial {0}", _shaderName); return(m_Materials [_id]); } Shader _shader = Shader.Find(_shaderName); if (null == _shader) { Debug.LogErrorFormat("shader {0} not found", _shaderName); return(null); } var _mtl = new Material(_shader); _mtl.hideFlags = HideFlags.HideAndDontSave; m_Materials.Add(_id, _mtl); return(_mtl); }
static void Main(string[] args) { HashDict <char, int> table = new HashDict <char, int>(); string input = Console.ReadLine(); foreach (var letter in input) { if (!table.ContainsKey(letter)) { table.Add(letter, 1); } else { table[letter]++; } } foreach (var letter in table.Keys) { Console.WriteLine($"{letter}: {table[letter]} time/s"); } Console.ReadLine(); }