/// <summary> /// Goes through each ConfigurablePart and find its associated spaces /// </summary> private void SetSpacesToConfigurableParts() { foreach (var part in ExistingParts.OfType <ConfigurablePart>()) { part.FindAssociatedSpaces(); } }
/// <summary> /// Clears the grid and populate a given amount of new configurable parts on the grid /// </summary> /// <param name="amt">The amount of parts to populate</param> /// <returns>The Texture that represents the grid state</returns> private Texture2D PopulateRandomConfigurableGetImage(int amt) { ClearGrid(); var configurables = ExistingParts.OfType <ConfigurablePart>(); foreach (var c in configurables) { c.DestroyGO(); } ExistingParts = new List <Part>(); for (int i = 0; i < amt; i++) { ConfigurablePart p = new ConfigurablePart(this, !_showVoxels, _popSeed); ExistingParts.Add(p); } //Write image to temp_sr folder return(ImageReadWrite.TextureFromGridOriginal(this)); }