public void Remove(Material mat, PlaneEffect effect) { if (!effect) { return; } Dictionary <Material, HashSet <PlaneEffect> > dict; if (dictionary.TryGetValue(effect.gameObject.layer, out dict)) { HashSet <PlaneEffect> set; if (dict.TryGetValue(mat, out set)) { set.Remove(effect); } } needUpdateMesh = true; }
public void Add(Material mat, PlaneEffect effect) { Dictionary <Material, HashSet <PlaneEffect> > dict; if (!dictionary.TryGetValue(effect.gameObject.layer, out dict)) { dict = new Dictionary <Material, HashSet <PlaneEffect> >(); dictionary.Add(effect.gameObject.layer, dict); } HashSet <PlaneEffect> set; if (!dict.TryGetValue(mat, out set)) { set = new HashSet <PlaneEffect>(); dict.Add(mat, set); } set.Add(effect); needUpdateMesh = true; }