Exemplo n.º 1
0
    public override void buttonEventBase(GameObject gameObj)
    {
        base.buttonEventBase(gameObj);
        if (gameObj.name == "close")
        {
            HeroRoadManagerment.Instance.clean();
            finishWindow();
        }
        else if (gameObj.name == "button_fight")
        {
            //进入英雄之章不进行是否在副本中检查

            /*
             * if(SweepManagement.Instance.hasSweepMission)
             * {
             *      UiManager.Instance.openDialogWindow<MessageWindow>((win)=>{
             *              win.initWindow(1,LanguageConfigManager.Instance.getLanguage("s0093"),null,LanguageConfigManager.Instance.getLanguage("sweepTip_09"),null);
             *      });
             * }else
             */
            //{
            HeroRoadItem currentItem = gameObj.transform.parent.gameObject.GetComponent <HeroRoadItem>();
            currentItem.OnBtnFightClick();
            itemIndex  = (int)gameObj.GetComponent <ButtonBase>().exFields["index"];
            currentTab = gameObj.GetComponent <ButtonBase>().exFields["tabName"].ToString();
            //}
            GuideManager.Instance.doGuide();
            GuideManager.Instance.guideEvent();
        }
    }
Exemplo n.º 2
0
    public override void tapButtonEventBase(GameObject gameObj, bool enable)
    {
        if (!enable)
        {
            return;
        }

        int quality = StringKit.toInt(gameObj.name);

        if (lastSelectQuality == quality)
        {
            return;
        }
        lastSelectQuality = quality;
        Utils.DestoryChilds(scrollContent, null, null);
        List <HeroRoad> list     = HeroRoadManagerment.Instance.getHeroRoadListByQuality(quality, fromCard == null ? 0 : fromCard.getEvolveNextSid());
        HeroRoadItem    lastItem = null;

        for (int i = 0; i < list.Count; i++)
        {
            GameObject obj = NGUITools.AddChild(scrollContent, itemPrefab);
            obj.SetActive(true);
            obj.transform.localPosition = new Vector3(0, i * -235, 0);
            obj.name = i.ToString();
            HeroRoadItem item = obj.GetComponent <HeroRoadItem> ();
            item.init(list [i]);
            if (lastItem != null)
            {
                lastItem.next = item;
            }
            lastItem = item;
            ButtonBase btn = item.buttonFight.GetComponent <ButtonBase> ();
            if (btn.exFields == null)
            {
                btn.exFields = new Hashtable();
            }

            //			Vector3 localpoint = new Vector3(item.transform.localPosition.x,item.transform.localPosition.y,item.transform.localPosition.z);
            btn.exFields.Add("index", i);
            btn.exFields.Add("tabName", gameObj.name);
            if (firstSelectTab && ((fromCard != null && list [i].sample.sid == fromCard.getEvolveNextSid()) ||
                                   (HeroRoadManagerment.Instance.currentHeroRoad != null &&
                                    HeroRoadManagerment.Instance.currentHeroRoad.sample.sid == list [i].sample.sid)))
            {
                needOpenItem   = item;
                firstSelectTab = false;
            }
        }
        scrollView.ResetPosition();

        if (needOpenItem != null)
        {
            openItemDetail(needOpenItem);
            needOpenItem = null;
        }
        if (currentTab != gameObj.name)
        {
            itemIndex = 0;
        }
        if (itemIndex != 0 && currentTab == gameObj.name)
        {
            Transform   jumpItem = null;
            Transform[] items    = new Transform[scrollContent.transform.childCount];
            foreach (Transform tmp in scrollContent.transform)
            {
                int index = (int)tmp.GetComponent <HeroRoadItem> ().buttonFight.GetComponent <ButtonBase> ().exFields ["index"];
                items [index] = tmp;
            }
            if (items [itemIndex] != null)
            {
                jumpItem = items [itemIndex - 1];
            }
            else
            {
                jumpItem = items [itemIndex - 2];
            }
            if (jumpItem != null)
            {
                openItemDetail(jumpItem.localPosition);
            }
        }
    }
Exemplo n.º 3
0
 public void openItemDetail(HeroRoadItem item)
 {
     SpringPanel.Begin(scrollView.gameObject, -item.transform.localPosition, 6f);
     return;
 }
Exemplo n.º 4
0
 public void     Initialize(HeroRoadItem heroRoadItem)
 {
     this.heroRoadItem = heroRoadItem;
     ShowHeroRoadItem();
     UpdateTalent();
 }