Beispiel #1
0
    // 点击zone按钮 进入stage
    public void OnClick(GameObject obj)
    {
        ZoneGameInfo parma = obj.GetComponent <ZoneGameInfo>();

        if (null == parma)
        {
            return;
        }

        StageMenu.Singleton.ShowMenu(parma.m_id);
        //MainUIManager.Singleton.OnSwitchSingelUI(MainUIManager.EDUITYPE.enStageMenu);

        MainMenu.Singleton.HideMain();

        OnHideName();
    }
Beispiel #2
0
    void OnPress()
    {
        GameObject obj = UIEventTrigger.current.gameObject;

        ZoneGameInfo parma = obj.GetComponent <ZoneGameInfo>();

        if (null == parma)
        {
            return;
        }

        ZoneTableInfo zoneInfo = GameTable.ZoneInfoTableAsset.LookUp(parma.m_id);

        if (null != zoneInfo)
        {
            m_zoneName.text = zoneInfo.m_name;
        }

        MainGame.Singleton.StartCoroutine(CoroutineDragOverAnimationEnd(++m_currentCorroutineDragOverIndex));
    }
Beispiel #3
0
    public override void AttachEvent()
    {
        base.AttachEvent();


        ZoneGameInfo[] zoneInfoList = WindowRoot.GetComponentsInChildren <ZoneGameInfo>();
        for (int i = 0; i < zoneInfoList.Length; ++i)
        {
            ZoneGameInfo zoneInfo = zoneInfoList[i];

            EventDelegate.Add(FindChild(zoneInfo.transform.name).GetComponent <UIEventTrigger>().onDragOut, OnHideName);

            AddChildMouseClickEvent(zoneInfo.transform.name, OnClick);
            //EventDelegate.Add(FindChild(zoneInfo.transform.name).GetComponent<UIEventTrigger>().onClick, OnClick);

            EventDelegate.Add(FindChild(zoneInfo.transform.name).GetComponent <UIEventTrigger>().onDragOver, OnChangeName);

            EventDelegate.Add(FindChild(zoneInfo.transform.name).GetComponent <UIEventTrigger>().onPress, OnPress);

            Debug.Log("zoneInfo.transform.name:" + zoneInfo.transform.name);
        }
    }