Get() 공개 정적인 메소드

public static Get ( GameObject go ) : UIEventListener,
go GameObject
리턴 UIEventListener,
예제 #1
0
 protected override void AddComponentEvents()
 {
     UIEventListener.Get(m_Panel.enterGameBtn.gameObject).onClick = OnClick;
     UIEventListener.Get(m_Panel.startGameBtn.gameObject).onClick = OnClick;
 }
예제 #2
0
    public void Init(Object obj)
    {
        if (m_Handle != null)
        {
            return;
        }
        ThirdLogon.Instance.m_blogon = false;

        m_Handle        = GameObject.Instantiate(obj) as GameObject;
        m_BaseTransform = m_Handle.transform;
        m_BaseTransform.SetParent(SceneObjMgr.Instance.UIPanelTransform, false);
        m_NoticeTrans     = m_BaseTransform.GetChild(6);
        m_NoticeObj       = m_NoticeTrans.gameObject;
        m_NoticeLabelItem = m_NoticeTrans.GetChild(1).GetChild(0).gameObject;
        for (byte i = 0; i < m_BtnObject.Length; ++i)
        {
            m_BtnObject[i] = m_BaseTransform.GetChild(i).gameObject;
            // if (i > 0)
            // m_BtnTrans[i - 1] = m_BtnObject[i].transform;
            UIEventListener.Get(m_BtnObject[i]).onClick = OnBtnOnclickMsg;
        }
        m_LabelObject = m_BaseTransform.GetChild(7).gameObject;
        m_UITips      = m_LabelObject.GetComponent <UILabel>();

        m_FacebookObj = m_BaseTransform.GetChild(8).gameObject;
        m_GuestObj    = m_BaseTransform.GetChild(9).gameObject;

        UIEventListener.Get(m_LabelObject).onClick = OnClickChannelLogon;
        UIEventListener.Get(m_BaseTransform.GetChild(4).gameObject).onClick           = ContentServiceEvent;
        UIEventListener.Get(m_BaseTransform.GetChild(5).gameObject).onClick           = ContentNoticeEvnet;
        UIEventListener.Get(m_NoticeTrans.GetChild(0).gameObject).onClick             = CloseNoticeEvent;
        UIEventListener.Get(m_NoticeTrans.GetChild(2).GetChild(0).gameObject).onClick = BackNoticeEvent;

        UIEventListener.Get(m_FacebookObj).onClick = OnClickFB;
        UIEventListener.Get(m_GuestObj).onClick    = OnClickGuest;
        ////return;
        //if (SDKMgr.IS_SDK_CHANNEL || ServerSetting.ShowThirdLoginBtn == false || RuntimeInfo.GetPlatform() == PlatformType.Windows)
        //{
        //    m_BaseTransform.GetChild(2).gameObject.SetActive(false);
        //    m_BaseTransform.GetChild(3).gameObject.SetActive(false);
        //}



        if (SDKMgr.IS_SDK_CHANNEL)
        {
            //m_LabelObject.SetActive(true);
            //m_UITips.text = StringTable.GetString("sdkchannel");
            m_FacebookObj.SetActive(true);
            for (byte i = 0; i < m_BtnObject.Length; ++i)
            {
                m_BtnObject[i].SetActive(false);
            }
            return;
        }
        else if (ServerSetting.ShowThirdLoginBtn == false || RuntimeInfo.GetPlatform() == PlatformType.Windows)//隐藏后面两个,并调整前面两个位置
        {
            m_BaseTransform.GetChild(2).gameObject.SetActive(false);
            m_BaseTransform.GetChild(3).gameObject.SetActive(false);

            m_BaseTransform.GetChild(0).position = Vector3.Lerp(m_BaseTransform.GetChild(0).position, m_BaseTransform.GetChild(1).position, 0.5f);
            m_BaseTransform.GetChild(1).position = Vector3.Lerp(m_BaseTransform.GetChild(2).position, m_BaseTransform.GetChild(3).position, 0.5f);
        }
        else
        {
            if (!m_BaseTransform.GetChild(3).gameObject.activeSelf)//根据第4个调整位置
            {
                m_BaseTransform.GetChild(1).position = Vector3.Lerp(m_BaseTransform.GetChild(0).position, m_BaseTransform.GetChild(3).position, 0.5f);
                m_BaseTransform.GetChild(2).position = m_BaseTransform.GetChild(3).position;
            }
        }


        //        m_BackgroundTex = m_BaseTransform.GetChild(3).GetComponent<UITexture>();
        //       m_BackgroundTex.mainTexture = SceneObjMgr.Instance.BackgroundTex;
        //effect
        //Object objEffect = ResManager.Instance.LoadObject("UIEf_Start", "LogonRes/Effect/", ResType.LogonRes);
        //m_goEffect = GameObject.Instantiate(objEffect) as GameObject;
        //m_goEffect.transform.SetParent(SceneObjMgr.Instance.UIPanelTransform, false);

        if (GlobalLogon.Instance.AccountData != null)
        {
            //m_BtnObject[0].SetActive(false);
            //m_BtnTrans[1].localPosition = m_BtnTrans[0].localPosition;
            //m_BtnTrans[0].localPosition = new Vector3(m_BtnTrans[0].localPosition.x, m_BtnTrans[0].localPosition.y + 75, m_BtnTrans[0].localPosition.z);
        }
    }
예제 #3
0
    private void ShowRegisterPopup()
    {
        registerObj.SetActive(true);

        UIEventListener.Get(submitButton.gameObject).onClick += SubmitNickname;
    }
 /// <summary>
 /// 根据奖赏信息刷新界面
 /// </summary>
 private void ShowWindows()
 {
     taskList = Obj_MyselfPlayer.GetMe().taskList;
     if (taskList != null)
     {
         taskList.Sort(CompareTo);
         //副本奖励提前
         List<UserTask> copyTask = new List<UserTask>();
         for (int n = 0; n < taskList.Count; n++)
         {
             if (taskList[n].taskType == 5 && taskList[n].state == 1)
             {
                 copyTask.Add(taskList[n]);
                 taskList.RemoveAt(n);
                 n--;
             }
         }
         copyTask.Sort(CompareTo);
         for (int m = 0; m < copyTask.Count; m++)
         {
             taskList.Insert(0, copyTask[m]);
         }
         copyTask.Clear();
         for (int i = 0; i < taskList.Count; i++)
         {
             GameObject newItem = ResourceManager.Instance.loadWidget(taskListItem);
             newItem.transform.parent = gridTask.transform;
             newItem.transform.localPosition = new Vector3(0, 0, -1);
             newItem.transform.localScale = new Vector3(1, 1, 1);
             newItem.name = taskList[i].templetID.ToString();
             //领取奖励
             UIEventListener.Get(newItem).onClick += FinishTask;
             //奖赏图片
             UISprite icon = newItem.transform.FindChild("CardIcon/CardIconBtn/Sprite-Icon").GetComponent<UISprite>();
             if (TableManager.GetCardByID(taskList[i].cardTempletID) != null)
             {
                 icon.spriteName = TableManager.GetAppearanceByID(TableManager.GetCardByID(taskList[i].cardTempletID).Appearance).HeadIcon;
             }
             else if (taskList[i].dollar > 0)
                 icon.spriteName = "yuanbao";
             else if (taskList[i].power > 0)
                 icon.spriteName = "tili";
             else if (taskList[i].gold > 0)
                 icon.spriteName = "jinbi";
             else if (taskList[i].propID > 0)
                 icon.spriteName = "daojubao";
             //名称
             UILabel titleLabel = newItem.transform.FindChild("Label-Title").GetComponent<UILabel>();
             titleLabel.text = taskList[i].title.ToString();
             Tab_Quest questList=TableManager.GetQuestByID(taskList[i].templetID);
             if(questList!=null)
             {
                 //奖励详细信息
                 if(questList.RewardOne!="-1")
                 {
                     UILabel goods1 = newItem.transform.FindChild("Label-Goods1").GetComponent<UILabel>();
                     goods1.text = questList.RewardOne;
                 }
                 if(questList.RewardTwo!="-1")
                 {
                     UILabel goods2 = newItem.transform.FindChild("Label-Goods2").GetComponent<UILabel>();
                     goods2.text = questList.RewardTwo;
                 }
             }
             //根据奖赏类型赋值奖赏进度信息
             UILabel stateLabel = newItem.transform.FindChild("Label-State-Value").GetComponent<UILabel>();
             if (taskList[i].taskType == 5 || taskList[i].taskType == 12)
             {
                 if (taskList[i].state == 1)
                 {
                     stateLabel.text = "1/1";
                 }
                 else
                 {
                     stateLabel.text = "0/1";
                 }
             }
             else
             {
                 stateLabel.text = taskList[i].process + "/" + taskList[i].request;
             }
             //奖赏状态信息赋值
             UISprite resultDoing = newItem.transform.FindChild("Sprite_doing").GetComponent<UISprite>();
             UISprite resultDone = newItem.transform.FindChild("Sprite_done").GetComponent<UISprite>();
             if (taskList[i].state == 1)
             {
                 resultDone.gameObject.SetActive(true);
                 resultDoing.gameObject.SetActive(false);
             }
             else
             {
                 Destroy(newItem.GetComponent<UIImageButton>());
                 resultDone.gameObject.SetActive(false);
                 resultDoing.gameObject.SetActive(true);
             }
             //for guide
             if (taskList[i].templetID == 1009)
                 guideItem = newItem;
             items.Add(newItem);
         }
     }
     gridTask.GetComponent<UIGrid>().repositionNow = true;
 }
예제 #5
0
    public void Init(VictPlayerType side, HeroData data, VictPlayerType type, VictPlayerData playerData, bool isSelf = false, bool isFriend = false)
    {
        if (side == type)
        {
            this.P_Frame.color = new Color32(7, 154, 0, 255);
            this.P_BG2.color   = new Color32(0, 154, 91, 171);
        }
        else
        {
            this.P_Frame.color = new Color32(222, 0, 0, 255);
            this.P_BG2.color   = new Color32(132, 5, 5, 171);
        }
        isSelf = playerData.IsControlPlayer;
        SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(data.HeroID);

        this.P_HeroPic.spriteName = heroMainData.avatar_icon;
        if (LevelManager.Instance.IsPvpBattleType)
        {
            this.P_SummonerName.text = playerData.SummonerName;
            this.P_SummonerSkill.gameObject.SetActive(true);
            SysSkillMainVo skillMainData = BaseDataMgr.instance.GetSkillMainData(playerData.SummonerSkillID);
            if (skillMainData != null)
            {
                this.P_SummonerSkill.mainTexture = ResourceManager.Load <Texture>(skillMainData.skill_icon, true, true, null, 0, false);
            }
            else
            {
                this.P_SummonerSkill.gameObject.SetActive(false);
            }
        }
        else
        {
            this.P_SummonerName.text = LanguageManager.Instance.GetStringById(heroMainData.name);
            this.P_SummonerSkill.gameObject.SetActive(false);
        }
        this.SetIsHighestKillHero(playerData.isHighestKillHero);
        this.SetIsHighestKillMonster(playerData.isHighestKillMonster);
        this.P_HeroLevel.text      = data.LV.ToString();
        this.P_HeroPic.parent.name = data.HeroID;
        this.P_KillHero.text       = playerData.KillHero.ToString();
        this.P_KillMonster.text    = playerData.KillMonster.ToString();
        this.P_Kill.text           = "/" + playerData.Death.ToString();
        this.P_KillAssist.text     = "/" + playerData.KillAssist.ToString();
        this.P_BG1.gameObject.SetActive(isSelf);
        if (isSelf)
        {
            this.P_SummonerName.color = new Color(0.9647059f, 0.9019608f, 0.360784322f);
        }
        else
        {
            this.P_SummonerName.color = Color.white;
        }
        if (playerData.SelfIsDeath && !GameManager.IsGameOver())
        {
            this.P_BG2.gameObject.SetActive(true);
            this.LeftDeathTimeLabel.text = playerData.LeftDeathTime.ToString();
        }
        else
        {
            this.P_BG2.gameObject.SetActive(false);
        }
        this.P_AddFriend.gameObject.SetActive(!isSelf && !isFriend);
        this.P_AddFriend.name = playerData.SummonerId;
        UIEventListener.Get(this.P_AddFriend.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickAddFriend);
        this.CheckEquipment(playerData);
        if (this.SilencedIcon != null)
        {
            UIEventListener.Get(this.SilencedIcon.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickBlock);
            if (Singleton <StatisticView> .Instance.blockedSummonerList.Contains(playerData.SummonerId))
            {
                this.SilencedOn(true);
            }
            else
            {
                this.SilencedOn(false);
            }
            if (!isSelf && side == type)
            {
                this.SilencedIcon.gameObject.SetActive(true);
            }
            else
            {
                this.SilencedIcon.gameObject.SetActive(false);
            }
        }
        if (playerData.LastChamRank <= 50)
        {
            this.P_SummonerName.gameObject.GetComponent <AllochroicLabelChecker>().RenderLabel(playerData.LastChamRank);
        }
    }
예제 #6
0
    protected override void OnShow(object data)
    {
        base.OnShow(data);
        PetAddPointPlanItem item = m_trans_jingshenPoint.gameObject.GetComponent <PetAddPointPlanItem>();

        if (item == null)
        {
            item = m_trans_jingshenPoint.gameObject.AddComponent <PetAddPointPlanItem>();
        }
        item.InitPetAddPlan(PetAttrEnum.JingShen);

        item = m_trans_liliangPoint.gameObject.GetComponent <PetAddPointPlanItem>();
        if (item == null)
        {
            item = m_trans_liliangPoint.gameObject.AddComponent <PetAddPointPlanItem>();
        }
        item.InitPetAddPlan(PetAttrEnum.Liliang);

        item = m_trans_minjiePoint.gameObject.GetComponent <PetAddPointPlanItem>();
        if (item == null)
        {
            item = m_trans_minjiePoint.gameObject.AddComponent <PetAddPointPlanItem>();
        }
        item.InitPetAddPlan(PetAttrEnum.MinJie);

        item = m_trans_zhiliPoint.gameObject.GetComponent <PetAddPointPlanItem>();
        if (item == null)
        {
            item = m_trans_zhiliPoint.gameObject.AddComponent <PetAddPointPlanItem>();
        }
        item.InitPetAddPlan(PetAttrEnum.ZhiLi);

        item = m_trans_tizhiPoint.gameObject.GetComponent <PetAddPointPlanItem>();
        if (item == null)
        {
            item = m_trans_tizhiPoint.gameObject.AddComponent <PetAddPointPlanItem>();
        }
        item.InitPetAddPlan(PetAttrEnum.TiZhi);


        m_label_totalnum.text = GameTableManager.Instance.GetGlobalConfig <uint>("LevelArg").ToString();
        int curgou = 0;
        var iter   = m_attrGouDic.GetEnumerator();

        if (m_dataManager.CurPet != null)
        {
            curgou = m_dataManager.CurPet.GetExPlan();
            while (iter.MoveNext())
            {
                var       dicitem = iter.Current;
                Transform gou     = dicitem.Value.Find("check/gou");
                Transform box     = dicitem.Value.Find("check/box");
                if (curgou == (int)dicitem.Key)
                {
                    gou.gameObject.SetActive(true);
                }
                else
                {
                    gou.gameObject.SetActive(false);
                }
                if (dicitem.Key == (int)PetAttrEnum.JingShen)
                {
                    UIEventListener.Get(box.gameObject).onClick = OnJingshenCheckClick;
                }
                else if (dicitem.Key == (int)PetAttrEnum.Liliang)
                {
                    UIEventListener.Get(box.gameObject).onClick = OnLiliangCheckClick;
                }
                else if (dicitem.Key == (int)PetAttrEnum.MinJie)
                {
                    UIEventListener.Get(box.gameObject).onClick = OnMinJieCheckClick;
                }
                else if (dicitem.Key == (int)PetAttrEnum.TiZhi)
                {
                    UIEventListener.Get(box.gameObject).onClick = OnTizhiCheckClick;
                }
                else if (dicitem.Key == (int)PetAttrEnum.ZhiLi)
                {
                    UIEventListener.Get(box.gameObject).onClick = OnZhiLiCheckClick;
                }
            }
        }
    }
예제 #7
0
    void UpdateSkill()
    {
        Entity     actor = null;
        Profession prof  = null;

        switch (operatType_)
        {
        case OperateType.OT_P1:
            actor = GamePlayer.Instance;
            break;

        case OperateType.OT_B:
            actor = GamePlayer.Instance.BattleBaby;
            break;
        }

        bool disable = false;

        if (operatType_ == OperateType.OT_P1)
        {
            if (Battle.Instance.P2SkillId_ != 0 && GamePlayer.Instance.BattleBaby == null)
            {
                if (Battle.Instance.P2SkillId_ != GlobalValue.GetAttackID(GamePlayer.Instance.GetWeaponType()) &&
                    Battle.Instance.P2SkillId_ != GlobalValue.SKILL_DEFENSEID &&
                    Battle.Instance.P2SkillId_ != GlobalValue.SKILL_FLEEID)
                {
                    disable = true;
                }
            }
            //    AttaclPanel.Instance.SetButtonState(false, AttaclPanel.SKILL_BTN, AttaclPanel.ARTICLE_BTN, AttaclPanel.PET_BTN, AttaclPanel.POSITION_BTN);
        }

        if (actor != null)
        {
            prof = Profession.get((JobType)actor.GetIprop(PropertyType.PT_Profession), actor.GetIprop(PropertyType.PT_ProfessionLevel));
            GameObject       go           = null;
            SkillData        skdata       = null;
            bool             isProudSkill = false;
            List <COM_Skill> skillList    = new List <COM_Skill>(actor.SkillInsts);
            if (actor.suitSkill != null)
            {
                skillList.Add(actor.suitSkill);
            }
            int realidx = 0;
            for (int i = 0; i < skillList.Count; ++i)
            {
                skdata = SkillData.GetData((int)skillList[i].skillID_, (int)skillList[i].skillLevel_);
                if (skdata._SkillType != SkillType.SKT_Active && skdata._SkillType != SkillType.SKT_Passive)
                {
                    continue;
                }

                if (Battle.Instance.disableLst_.Contains(GetSkillIndex(skdata._Id)))
                {
                    continue;
                }

                go = GameObject.Instantiate(item_) as GameObject;
                UIManager.SetButtonEventHandler(go, EnumButtonEvent.OnClick, OnClickSkill, skdata._Id, skdata._Level);
                go.transform.parent     = grid_;
                go.transform.localScale = Vector3.one;

                UIEventListener.Get(go).parameter = disable ? 0 : 1;

                if (prof == null)
                {
                    isProudSkill = false;
                }
                else
                {
                    isProudSkill = prof.isProudSkill(actor.GetIprop(PropertyType.PT_Profession), skdata._Id, skdata._Level);
                }
                go.GetComponent <ChangeAutoIcon>().SetData(skdata._Id, skdata._Level, isProudSkill);
                go.SetActive(true);

                if (realidx == 0)
                {
                    GuideManager.Instance.RegistGuideAim(go, GuideAimType.GAT_FirstAutoSkill);
                }
                realidx++;
            }
            grid_.GetComponent <UIGrid>().Reposition();
        }
    }