public void OnClickedStageButton(GameObject button) { if (button.name.Equals("back")) { MainMenu.SetActive(true); SelectStage.SetActive(false); gameManager.fsm.next = StateType.MainMenu; GameObject.Find("Art Design").GetComponent <MainArtDesign>().ChangeLensFlare(StateType.MainMenu); } else { gameManager.stageNum = button.name[button.name.Length - 1] - '1'; Debug.Log(gameManager.stageNum); gameManager.fsm.next = StateType.LoadStage; } }
// Use this for initialization void Start() { iSelectStage = iSelectJiki = 0; SelectJiki.SetActive(true); SelectStage.SetActive(false); Button b_btn = B_Button.GetComponent <Button>(); b_btn.onClick.AddListener(B_ButtonOnClick); Button p_btn = P_Button.GetComponent <Button>(); p_btn.onClick.AddListener(P_ButtonOnClick); Button s_btn = S_Button.GetComponent <Button>(); s_btn.onClick.AddListener(S_ButtonOnClick); Button d_btn = D_Button.GetComponent <Button>(); d_btn.onClick.AddListener(D_ButtonOnClick); Button one_btn = ONE_Button.GetComponent <Button>(); one_btn.onClick.AddListener(One_ButtonOnClick); Button two_btn = TWO_Button.GetComponent <Button>(); two_btn.onClick.AddListener(Two_ButtonOnClick); Button three_btn = THREE_Button.GetComponent <Button>(); three_btn.onClick.AddListener(Three_ButtonOnClick); Button four_btn = FOUR_Button.GetComponent <Button>(); four_btn.onClick.AddListener(Four_ButtonOnClick); Button five_btn = FIVE_Button.GetComponent <Button>(); five_btn.onClick.AddListener(Five_ButtonOnClick); Button return_Button = Return_Button.GetComponent <Button>(); Return_Button.onClick.AddListener(Return_ButtonOnClick); }
public void OnClickedSelectStageButton(GameObject button) { if (button.transform.parent.name.Equals("Result")) { SceneManager.LoadScene("MainMenu"); gameManager.fsm.next = StateType.LoadTitle; } Debug.Log("SelectStageclicked"); MainMenu.SetActive(false); SelectStage.SetActive(true); for (int i = 0; i < gameManager.stages.Count; i++) { if (!gameManager.stages[i].isCleared) { SelectStage.transform.Find("stage" + (i + 1).ToString()).GetComponent <Button>().interactable = false; } } GameObject.Find("Art Design").GetComponent <MainArtDesign>().ChangeLensFlare(StateType.SelectStage); gameManager.fsm.next = StateType.SelectStage; }
void D_ButtonOnClick() { iSelectJiki = 3; SelectJiki.SetActive(false); SelectStage.SetActive(true); }
void Return_ButtonOnClick() { SelectJiki.SetActive(true); SelectStage.SetActive(false); }