// Adds a new wingset and keeps track of it static public void AddWing(GameObject body, Phenotype phenotype, Rigidbody[] wingSegments, HingeJoint[] wingJoints) { Rigidbody[] wingPolygons = createWingPolygons(wingSegments, GlobalSettings.standardWingDesignIndices); WingSet wingSet = new WingSet(body, phenotype, wingPolygons, wingJoints); body.GetComponent <DragonScript>().wingSet = wingSet; wingSet.RenderVisualisation(((activeWings.Count < GlobalSettings.maxRenderedMembranes) && GlobalSettings.renderingMembranes)); activeWings.Add(wingSet); }
static public void DestroyWing(WingSet wingSet) { activeWings.Remove(wingSet); wingSet.Destroy(); wingSet = null; }