Button EditorButtonClicked(Enums.SubOptionButtons buttonName) { switch (buttonName) { case Enums.SubOptionButtons.Body: return(btnBody); case Enums.SubOptionButtons.Texture: return(btnTexture); default: return(btnAction); } }
public void SetSubOptionPanelActive(int subOptionButtonIndex) { Enums.SubOptionButtons clickedButtonName = (Enums.SubOptionButtons)subOptionButtonIndex; Button clickedButton = EditorButtonClicked(clickedButtonName); if (subOptionPanel.activeSelf == true && clickedButton == oldClickedButton) { SetEditorModeButtons(false, oldClickedButton, oldClickedButtonName.ToString()); oldClickedButton = null; } else { if (subOptionPanel.activeSelf == true) { SetEditorModeButtons(false, oldClickedButton, oldClickedButtonName.ToString()); } subOptionTitle.text = clickedButtonName + Constants.subOption; if (clickedButtonName == Enums.SubOptionButtons.Body || IsBodyChosen(Constants.meesageforBodyIsNotChosen)) { ClearSubOptionPanel(); SetEditorModeButtons(true, clickedButton, clickedButtonName + Constants.clickToClose); oldClickedButton = clickedButton; oldClickedButtonName = clickedButtonName; switch (clickedButtonName) { case Enums.SubOptionButtons.Body: DisplayBodyList(); break; case Enums.SubOptionButtons.Texture: DisplayTextureList(); break; case Enums.SubOptionButtons.Action: DisplayAnimationList(); break; } } } }