Exemplo n.º 1
0
    public override void RegisterEvent()
    {
        {
            DragEventListener listener = view.StartGame.gameObject.GetComponent <DragEventListener>();
            if (listener == null)
            {
                listener = view.StartGame.gameObject.AddComponent <DragEventListener>();
                listener.OnClickEvent += delegate(PointerEventData eventData) {
                    mUIMgr.CloseCertainPanel(this);
                    AdjustInitCtrl ctrl = mUIMgr.ShowPanel("AdjustPanel") as AdjustInitCtrl;
                    ctrl.SetRoleId(nowIdx);
                };
            }
        }

        foreach (RoleItemView vv in view.roleList)
        {
            ClickEventListerner listener = vv.clickArea.gameObject.GetComponent <ClickEventListerner>();
            if (listener == null)
            {
                listener = vv.clickArea.gameObject.AddComponent <ClickEventListerner>();
                listener.OnClickEvent += delegate(PointerEventData eventData) {
                    switchSelectedStory(view.roleList.IndexOf(vv));
                };
            }
        }
    }
Exemplo n.º 2
0
    public override void RegisterEvent()
    {
        view.NewGame.onClick.AddListener(delegate() {
            mUIMgr.CloseCertainPanel(this);
            //mUIMgr.ShowPanel("StartNewGame");
            //跳过选人直接开始
            AdjustInitCtrl ctrl = mUIMgr.ShowPanel("AdjustPanel") as AdjustInitCtrl;
            ctrl.SetRoleId(0);
        });

        view.LoadGame.onClick.AddListener(delegate() {
            mUIMgr.CloseCertainPanel(this);
            //mUIMgr.ShowPanel("StartNewGame");
            //跳过选人直接开始
            AdjustInitCtrl ctrl = mUIMgr.ShowPanel("AdjustPanel") as AdjustInitCtrl;
            ctrl.SetRoleId(0);
        });

        view.Setting.onClick.AddListener(delegate() {
            //setting
            view.SetPage.gameObject.SetActive(true);
        });

        view.Quit.onClick.AddListener(delegate() {
            Debug.Log("Quit Game");
            Application.Quit();
        });

        view.Back.onClick.AddListener(delegate()
        {
            view.SetPage.gameObject.SetActive(false);
        });

        view.BGMVolume.onValueChanged.AddListener(delegate
        {
            GameMain.GetInstance().AdjustVolume(view.BGMVolume.value);
            view.VolumeNum.text = view.BGMVolume.value * 100 + "";
        });
    }