private void PopulateDataTableFromFile() { m_dbFile = CustomShaderDatabaseFileIO.ReadDatabaseFromFile(); m_closetHitShaderList = new SortedSet <string>(); m_closetHitShaderMetaList = new SortedSet <CustomShaderMeta>(comparer: new CustomShaderMetaComparer()); m_intersectShaderList = new SortedSet <string>(); m_intersectShaderMetaList = new SortedSet <CustomShaderMeta>(comparer: new CustomShaderMetaComparer()); foreach (var kvp in m_dbFile.closetHit) { // Shader Name = kvp.Value.name // Shader GUID = kvp.Key m_closetHitShaderList.Add(kvp.Value.name); m_closetHitShaderMetaList.Add(kvp.Value); } foreach (var kvp in m_dbFile.intersect) { // Shader Name = kvp.Value.name // Shader GUID = kvp.Key m_intersectShaderList.Add(kvp.Value.name); m_intersectShaderMetaList.Add(kvp.Value); } }
public void AddIntersectShader(CustomShaderMeta shaderMeta) { var guid = Guid.NewGuid().ToString(); m_intersectShaderList.Add(shaderMeta.name); m_intersectShaderMetaList.Add(shaderMeta); m_dbFile.intersect.Add(guid, shaderMeta); CustomShaderDatabaseFileIO.WriteDatabaseToFile(m_dbFile); }