public void CreateChoicesMenuEvent() { //prefab = Resources.Load<GameObject>("UI/UIForms/ChoiceMenu"); //GameObject clo = Instantiate(prefab); var unityEvent = new UnityEvent(); unityEvent.AddListener(goback); CommonButton.Get(goBreak).m_OnClick = unityEvent; var ChoiceLeftEventid = new UnityEvent(); ChoiceLeftEventid.AddListener(minusChapterID); CommonButton.Get(ChoiceLeft).m_OnClick = ChoiceLeftEventid; var ChoiceRightEventid = new UnityEvent(); ChoiceRightEventid.AddListener(plusChapterID); CommonButton.Get(ChoiceRight).m_OnClick = ChoiceRightEventid; //-----------test var testunityEvent = new UnityEvent(); testunityEvent.AddListener(testPass); CommonButton.Get(test_image).m_OnClick = testunityEvent; }
public void CreateHomeMenuEvent() { //GameEntry.UI.OpenUIForm(UIFormId.HomeMenu, this); //prefab = Resources.Load<GameObject>("UI/UIForms/HomeMenu"); //GameObject clo = Instantiate(prefab); var ClickLeftEvent = new UnityEvent(); ClickLeftEvent.AddListener(ClickLeftButton); CommonButton.Get(left).m_OnClick = ClickLeftEvent; var ClickRightEvent = new UnityEvent(); ClickRightEvent.AddListener(ClickRightButton); CommonButton.Get(right).m_OnClick = ClickRightEvent; }
protected internal override void OnOpen(object userData) #endif { base.OnOpen(userData); m_ProcedureMenu = (ProcedureMenu)userData; if (m_ProcedureMenu == null) { Log.Warning("ProcedureMenu is invalid when open MenuForm."); return; } if (m_StartGameButton) { var unityEvent = new UnityEvent(); unityEvent.AddListener(StartGameEvent); CommonButton.Get(m_StartGameButton).m_OnClick = unityEvent; } }