public void OnGeneralTechniqueChange(Dropdown dropDown) { _generalTechnique = (GeneralTechnique)dropDown.value; Debug.Log(_generalTechnique); clustersDropdown.ClearOptions(); var opt = new List <string>(); switch (_generalTechnique) { case GeneralTechnique.Damask: opt.Clear(); opt.Add("2"); break; case GeneralTechnique.Spolined: opt.Clear(); opt = Enumerable.Range(1, 25).Select(n => n.ToString()).ToList(); break; case GeneralTechnique.SpolinedDamask: opt.Clear(); opt = Enumerable.Range(3, 25).Select(n => n.ToString()).ToList(); break; case GeneralTechnique.Brocade: opt.Clear(); opt.Add("2"); break; case GeneralTechnique.Lampas: opt.Clear(); opt.Add("2"); break; case GeneralTechnique.Freestyle: opt.Clear(); opt = Enumerable.Range(1, 16).Select(n => n.ToString()).ToList(); break; } clustersDropdown.AddOptions(opt); clusterCount = Convert.ToInt32(clustersDropdown.options[clustersDropdown.value].text); selectedTechniqueRestrictions = techniqueRestrictions.First(t => t.technique == _generalTechnique).Clone(); selectedWeave = selectedTechniqueRestrictions.defaultWeave; freestyleOptions.SetActive(_generalTechnique == GeneralTechnique.Freestyle); if (_generalTechnique == GeneralTechnique.Freestyle) { foreach (var toggle in freestyleOptions.GetComponentsInChildren <Toggle>()) { toggle.isOn = false; brocadedFreestyle = false; } selectedTechniqueRestrictions.backgroundWeftCount = 1; } }
private void Awake() { clusterList = new List <Color>(); imageProcessingResults = new List <Mat>(); yarnPanels = new List <YarnPanel>(); yarnEntities = new List <YarnEntity>(); techniqueRestrictions = Resources.LoadAll <WeavingTechniqueRestrictions>("WeavingTechniques").ToList(); selectedTechniqueRestrictions = techniqueRestrictions.First(t => t.technique == GeneralTechnique.Damask).Clone(); selectedWeave = selectedTechniqueRestrictions.defaultWeave; labelsMatrix = new Mat(); }