// Destroys all holders + reset public void DestroyAndReset() { UtilSort.DestroyObjects(holders); containsHolders = false; HolderBase.HOLDER_NR = 0; superElement = null; }
public void InitSortAlgorithm(SortMain sortMain, float algorithmSpeed) { this.sortMain = sortMain; InitTeachingAlgorithm(algorithmSpeed); minValue = sortMain.ElementManager.MinValue; maxValue = sortMain.ElementManager.MaxValue; }
// Destroys all elements + reset public void DestroyAndReset() { Util.DestroyObjects(sortingElements); containsElements = false; SortingElementBase.SORTING_ELEMENT_NR = 0; usedValues = new HashSet <int>(); currentMoving = null; superElement = null; }
public void InitManager() { superElement = GetComponent <SortMain>(); }
public void InitManager() // not really needed anymore { superElement = GetComponentInParent <SortMain>(); }
/* Creates a list of objects * - Puts them ontop of another object if positions are provided */ public static GameObject[] CreateObjects(GameObject prefab, int numberOfElements, Vector3[] pos, float spreadDist, SortMain superElement) { GameObject[] objects = new GameObject[numberOfElements]; GameObject element; for (int x = 0; x < numberOfElements; x++) { if (pos.Length == 1) { element = Instantiate(prefab, pos[0] + new Vector3(x * spreadDist, 0f, 0f), Quaternion.identity); } else { element = Instantiate(prefab, pos[x], Quaternion.identity); } element.GetComponent <ISortSubElement>().SuperElement = superElement; objects[x] = element; } return(objects); }
public void InitSortingManager(SortMain sortMain) { this.sortMain = sortMain; Debug.Log("Algorithm: " + AlgorithmManager); }