public void Remove(ContactMaterial contactMaterial) { int index = -1; while ((index = Array.FindIndex(ContactMaterials, cm => { return(cm == contactMaterial); })) >= 0) { m_contactMaterials.RemoveAt(index); } }
public void Add(ContactMaterial contactMaterial) { if (contactMaterial == null || ContactMaterials.Contains(contactMaterial)) { return; } m_contactMaterials.Add(new ContactMaterialEntry() { ContactMaterial = contactMaterial }); }
protected override bool Initialize() { RemoveNullEntries(); foreach (var entry in m_contactMaterials) { ContactMaterial contactMaterial = entry.ContactMaterial.GetInitialized <ContactMaterial>(); if (contactMaterial != null && contactMaterial.Native != null) { GetSimulation().getMaterialManager().add(contactMaterial.Native); } } return(base.Initialize()); }