private EnabledMutator CreateEnabledButton(Mutator mutator) { GameObject newButton = Instantiate(EnabledPrefab, EnabledParent); EnabledMutator enabled = newButton.GetComponent <EnabledMutator>(); return(enabled); }
public void RemoveMutator(string identifier) { // Disable it if it is enabled. EnabledMutator enabled = GetEnabledMutator(identifier); if (enabled) { DisableMutator(enabled.Mutator); } // Destroy the button. Destroy(GetAvailableMutator(identifier).gameObject); // Remove from list. _allMutators.RemoveAll(x => x.Identifier == identifier); }