new env int
This commit is contained in:
@@ -54,6 +54,20 @@ public class ComboSelection : MonoBehaviour
|
||||
Refresh();
|
||||
}
|
||||
|
||||
public void SetValue(string newVal){
|
||||
for(int i=0; i < Options.Length; i++){
|
||||
if(Options[i].ToLower() == newVal.ToLower()){
|
||||
SelectedIndex = i;
|
||||
Refresh();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Debug.LogError($"Cant set value to an non-existing option ({newVal})");
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void Refresh(){
|
||||
selectedText.text = Options[SelectedIndex];
|
||||
SelectedOption = Options[SelectedIndex];
|
||||
|
||||
Reference in New Issue
Block a user