示例#1
0
    public override void Init()
    {
        base.Init();
        #region 技能
        this.m_Button_SkillQ = base.GetUIObject("pn_skill/bt_skillQ") as IXUIButton;
        this.m_Button_SkillW = base.GetUIObject("pn_skill/bt_skillW") as IXUIButton;
        this.m_Button_SkillE = base.GetUIObject("pn_skill/bt_skillE") as IXUIButton;
        this.m_Button_SkillR = base.GetUIObject("pn_skill/bt_skillR") as IXUIButton;
        this.m_Button_Attack = base.GetUIObject("bt_attack") as IXUIButton;

        this.m_Sprite_SkillQ = base.GetUIObject("pn_skill/bt_skillQ/sp_skillQ") as IXUISprite;
        this.m_Sprite_SkillW = base.GetUIObject("pn_skill/bt_skillW/sp_skillW") as IXUISprite;
        this.m_Sprite_SkillE = base.GetUIObject("pn_skill/bt_skillE/sp_skillE") as IXUISprite;
        this.m_Sprite_SkillR = base.GetUIObject("pn_skill/bt_skillR/sp_skillR") as IXUISprite;
        #endregion
        #region 角色
        this.m_List_RoleList     = base.GetUIObject("pn_rolelist/gd_rolelist") as IXUIList;
        this.m_Label_RoleName    = base.GetUIObject("bt_avatar/sp_avatar_bg/lb_name") as IXUILabel;
        this.m_Sprite_AvatarIcon = base.GetUIObject("bt_avatar/sp_avatar_bg/sp_avatar") as IXUISprite;
        this.m_Label_Speed       = base.GetUIObject("pn_rolestatus/sp_speed/lb_speed") as IXUILabel;
        this.m_Label_Life        = base.GetUIObject("pn_rolestatus/sp_life/lb_life") as IXUILabel;
        #endregion
        #region 结束按钮
        this.m_Button_Finish = base.GetUIObject("bt_end") as IXUIButton;
        this.m_Label_Finish  = base.GetUIObject("bt_end/sp_background/lb_end") as IXUILabel;
        #endregion
        #region 移动按钮
        this.m_Button_Move = base.GetUIObject("bt_move") as IXUIButton;
        #endregion
    }
示例#2
0
 /// <summary>
 /// 刷新神兽选择之后的状态
 /// </summary>
 public void RefreshBeastSelectStatus()
 {
     if (base.uiBehaviour != null)
     {
         for (int i = 0; i < base.uiBehaviour.m_BeastList.Count; i++)
         {
             IXUIListItem item = base.uiBehaviour.m_BeastList.GetItemByIndex(i);
             if (item != null)
             {
                 IXUISprite icon = item.GetUIObject("Icon") as IXUISprite;
                 if (icon != null)
                 {
                     icon.Color = Color.white;
                 }
             }
         }
         //循环遍历所有已经选择的英雄,设置icon为灰色
         foreach (var current in this.m_dicRoleSelectBeastID)
         {
             if (this.m_unRandomBeastID != current.Value && this.m_lBeastIdCurrent != current.Value)
             {
                 IXUIListItem item = base.uiBehaviour.m_BeastList.GetItemById((uint)current.Value);
                 if (item != null && item.Index > 0)
                 {
                     IXUISprite icon = item.GetUIObject("Icon") as IXUISprite;
                     if (icon != null)
                     {
                         icon.Color = UnityTools.GrayColor;
                     }
                 }
             }
         }
         //如果可以重复选择,就不设置为灰色
         if (Singleton <RoomManager> .singleton.RepeatSelectBeastInAllCamp == 1)
         {
             foreach (var current in this.m_dicRoleSelectBeastID)
             {
                 if (this.m_unRandomBeastID != current.Value && this.m_lBeastIdCurrent != current.Value)
                 {
                     IXUIListItem item = base.uiBehaviour.m_BeastList.GetItemById((uint)current.Value);
                     if (item != null && item.Index > 0)
                     {
                         IXUISprite icon = item.GetUIObject("Icon") as IXUISprite;
                         if (icon != null)
                         {
                             icon.Color = Color.white;
                         }
                     }
                 }
             }
         }
         if (Singleton <RoomManager> .singleton.IsLadderMode() && Singleton <RoomManager> .singleton.EGamePhase == EGamePhase.GAME_PHASE_CHOOSING)
         {
             //开始协程刷新被ban的神兽头像icon颜色
         }
     }
 }
示例#3
0
 public override void Init()
 {
     base.Init();
     this.m_button = base.GetUIObject("Sprite") as IXUISprite;
     if (this.m_button == null)
     {
         Debug.LogError("this.button == null");
     }
 }
示例#4
0
 protected void OnItemSelect(IXUISprite sp)
 {
     if (this._callback != null)
     {
         this._callback((int)sp.ID);
     }
     if (this.close != null)
     {
         this.close.Play(true);
     }
     this.selecttext.text = this.items[(int)sp.ID];
 }
示例#5
0
    private void RefreshPlayerInfo(IXUIListItem item, BeastData beast)
    {
        //DataBeastlist dataBeast = GameData<DataBeastlist>.dataMap[beast.BeastTypeId];
        DataBeastlist dataBeast = null;

        GameData <DataBeastlist> .dataMap.TryGetValue(beast.BeastTypeId, out dataBeast);

        IXUISprite icon = item.GetUIObject("Sprite_Icon") as IXUISprite;

        if (dataBeast != null)
        {
            //如果是自己的阵营,就显示头像。地方就显示随机头像
            if (beast.CampType == Singleton <PlayerRole> .singleton.CampType)
            {
                icon.SetSprite(dataBeast.IconFile, UIManager.singleton.GetAtlasName(EnumAtlasType.Beast, dataBeast.IconFile));
            }
            else
            {
                //icon.SetSprite("Window");
                icon.SetSprite(dataBeast.IconFile, UIManager.singleton.GetAtlasName(EnumAtlasType.Beast, dataBeast.IconFile));
            }
        }
        else
        {
            if (beast.BeastTypeId == this.m_unRandomBeastID)
            {
                icon.SetSprite("9");
            }
        }
        bool     visible   = Singleton <RoomManager> .singleton.IsObserver || Singleton <PlayerRole> .singleton.CampType == beast.CampType;
        IXUIList equipList = item.GetUIObject("List_Equip") as IXUIList;

        if (equipList != null)
        {
        }
        else
        {
            XLog.Log.Error("null == uiListEquip");
        }
        this.RefreshItemEnable(item, beast.Id);
        IXUIObject uiObject = item.GetUIObject("Texture_Shadow");

        if (uiObject != null)
        {
            uiObject.SetVisible(false);
        }
        item.Id = beast.Id;
    }
 public override void Init()
 {
     base.Init();
     #region 开始战斗按钮
     this.m_Button_Play = base.GetUIObject("Play/PlayButton") as IXUIButton;
     if (this.m_Button_Play == null)
     {
         Debug.Log("Play/PlayButton == null");
     }
     #endregion
     #region 角色名字
     this.m_Label_Name = base.GetUIObject("RoleStatus/Name/NameLabel") as IXUILabel;
     if (this.m_Label_Name == null)
     {
         Debug.Log("RoleStatus/Name/Label == null");
     }
     #endregion
     #region 角色头像
     this.m_Sprite_Avatar = base.GetUIObject("RoleStatus/Avatar/Icon") as IXUISprite;
     if (this.m_Sprite_Avatar == null)
     {
         Debug.Log("RoleStatus/Avatar/Icon == null");
     }
     #endregion
     #region 角色等级
     this.m_Label_Level = base.GetUIObject("RoleStatus/Avatar/Level") as IXUILabel;
     if (this.m_Label_Level == null)
     {
         Debug.Log("RoleStatus/Avatar/Level == null");
     }
     #endregion
     #region 角色金币
     this.m_Label_Money = base.GetUIObject("RoleStatus/Gold/GoldLabel") as IXUILabel;
     if (this.m_Label_Money == null)
     {
         Debug.Log("RoleStatus/Gold/Label == null");
     }
     #endregion
     #region 角色点券
     this.m_Label_Ticket = base.GetUIObject("RoleStatus/Ticket/TicketLabel") as IXUILabel;
     if (this.m_Label_Ticket == null)
     {
         Debug.Log("RoleStatus/Ticket/TicketLabel");
     }
     #endregion
 }
示例#7
0
 public FlyTextEntity(IXUIListItem flyTextItem, long unTargetHeroId)
 {
     this.m_bActive         = true;
     this.m_unTargetBeastId = unTargetHeroId;
     this.m_uiListItem      = flyTextItem;
     this.m_uiLabel         = (this.m_uiListItem.GetUIObject("Label_FlyText") as IXUILabel);
     this.m_uiSprite        = (this.m_uiListItem.GetUIObject("Sprite_Shadow") as IXUISprite);
     if (null == this.m_uiLabel)
     {
         this.m_uiLabel = WidgetFactory.CreateWidget <IXUILabel>();
         XLog.Log.Debug("null == m_uiLabel");
     }
     if (null == this.m_uiSprite)
     {
         this.m_uiSprite = WidgetFactory.CreateWidget <IXUISprite>();
     }
 }
示例#8
0
 private void LoadFinishClean()
 {
     this.JY                    = null;
     this.Black                 = null;
     this.JYPlayTween           = null;
     this.BlackPlayTween        = null;
     this.StatusText            = null;
     this.VersionText           = null;
     this.ClickBox              = null;
     this.mDialogCallBack       = null;
     this.mDialogCancelCallBack = null;
     this.mDialogCancelBtn      = null;
     this.mDialogSureBtn        = null;
     this.mDialogCapacityLabel  = null;
     this.mDialogTransform      = null;
     this.mDownLoadNewBtn       = null;
     this.mDownLoadTransform    = null;
 }
 //public IXUIProgress m_progressBar = null;
 #endregion
 #region 属性
 #endregion
 #region 构造方法
 #endregion
 #region 公有方法
 public override void Init()
 {
     base.Init();
     #region 我方角色
     this.m_list_OurPlayer = base.GetUIObject("Top/OurPlayerList") as IXUIList;
     #endregion
     #region 敌方角色
     this.m_list_EnemyPlayer = base.GetUIObject("Down/EnemyPlayerList") as IXUIList;
     #endregion
     #region 加载背景
     this.m_sprite_Bg = base.GetUIObject("Background") as IXUISprite;
     #endregion
     #region 加载时的小提示
     this.m_label_Tip = base.GetUIObject("Center/Label_Tip") as IXUILabel;
     #endregion
     #region 加载进度条
     //this.m_progressBar = base.GetUIObject("") as IXUIProgress;
     #endregion
 }
示例#10
0
        public override bool Init()
        {
            PlayerPrefs.SetString("Language", "Language");
            GameObject.Find("UIRoot/StartLoadingDlg/Bg/Ailin");
            GameObject gameObject  = GameObject.Find("UIRoot/StartLoadingDlg/Bg/JY");
            GameObject gameObject2 = GameObject.Find("UIRoot/StartLoadingDlg/Bg").transform.FindChild("Black").gameObject;

            this.StatusText     = (GameObject.Find("UIRoot/StartLoadingDlg/Bg/LabelStatus").GetComponent("XUILabel") as IXUILabel);
            this.VersionText    = (GameObject.Find("UIRoot/StartLoadingDlg/Bg/LabelVersion").GetComponent("XUILabel") as IXUILabel);
            this.JY             = (gameObject.GetComponent("XUISprite") as IXUISprite);
            this.Black          = (gameObject2.GetComponent("XUISprite") as IXUISprite);
            this.JYPlayTween    = (gameObject.GetComponent("XUIPlayTween") as IXUITweenTool);
            this.BlackPlayTween = (gameObject2.GetComponent("XUIPlayTween") as IXUITweenTool);
            this.JYPlayTween.SetTargetGameObject(gameObject);
            this.JYPlayTween.RegisterOnFinishEventHandler(new OnTweenFinishEventHandler(this.OnJYPlayTweenFinish));
            this.Black.SetVisible(true);
            this.BlackPlayTween.SetTargetGameObject(gameObject2);
            this.BlackPlayTween.RegisterOnFinishEventHandler(new OnTweenFinishEventHandler(this.OnBlackPlayTweenFinish));
            this.StatusText.SetVisible(false);
            this.VersionText.SetVisible(false);
            this.Black.SetVisible(false);
            this.JY.SetVisible(true);
            this.JYPlayTween.PlayTween(true, -1f);
            this.ClickBox = (GameObject.Find("UIRoot/StartLoadingDlg/Bg").GetComponent("XUISprite") as IXUISprite);
            this.ClickBox.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnBoxClick));
            this.mTextureTransform    = GameObject.Find("UIRoot/StartLoadingDlg/Bg/Texture").transform;
            this.mDialogTransform     = GameObject.Find("UIRoot/StartLoadingDlg/Bg/Dialog").transform;
            this.mDialogSureBtn       = (this.mDialogTransform.FindChild("OK").GetComponent("XUIButton") as IXUIButton);
            this.mDialogCancelBtn     = (this.mDialogTransform.FindChild("Cancel").GetComponent("XUIButton") as IXUIButton);
            this.mDialogCapacityLabel = (this.mDialogTransform.FindChild("CapacityValue").GetComponent("XUILabel") as IXUILabel);
            this.mDialogSureBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnDialogSureClick));
            this.mDialogCancelBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnDialogCancelClick));
            this.mTextureTransform.gameObject.SetActive(false);
            this.mDialogTransform.gameObject.SetActive(false);
            this.mDownLoadTransform = GameObject.Find("UIRoot/StartLoadingDlg/Bg/DownNew").transform;
            this.mDownLoadNewBtn    = (this.mDownLoadTransform.FindChild("OK").GetComponent("XUIButton") as IXUIButton);
            this.mDownLoadTransform.gameObject.SetActive(false);
            this.mDownLoadNewBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnDownLoadCallback));
            return(true);
        }
示例#11
0
    /// <summary>
    /// 显示随机神兽的icon
    /// </summary>
    private void ShowRandomBeast()
    {
        this.m_log.Debug("ShowRandomBeast");
        IXUIListItem item = base.uiBehaviour.m_BeastList.GetItemByIndex(0);

        if (item != null)
        {
            IXUISprite weekIcon = item.GetUIObject("Week") as IXUISprite;
            if (weekIcon != null)
            {
                weekIcon.SetVisible(false);
            }
            IXUISprite Icon = item.GetUIObject("Icon") as IXUISprite;
            if (Icon != null)
            {
                Icon.SetSprite("9");
                item.Id       = this.m_unRandomBeastID;
                item.TipParam = new TipParam
                {
                    Tip = "随机选择一名您拥有的神兽,包括周免神兽"
                };
            }
        }
    }
示例#12
0
    private void ShowCampTypeEffect(IXUIListItem item)
    {
        if (item != null)
        {
            bool      flag      = true;
            BeastData beastData = Singleton <RoomManager> .singleton.GetBeastData(item.Id);

            if (beastData != null && beastData.BeastTypeId > -1 && beastData.IsSelected)
            {
                flag = false;
            }
            IXUISprite mask = item.GetUIObject("UnSelectMask") as IXUISprite;
            if (mask != null)
            {
                bool flag1 = item.Id > 0 && flag;
                if (flag1 && Singleton <RoomManager> .singleton.BeastSelectType == EGameBeastSelectType.GAME_BEAST_SELECT_TYPE_RANK && this.m_lBeastIdCurrent != item.Id)
                {
                    flag1 = false;
                }
                mask.SetVisible(flag1);
            }
            else
            {
                Debug.Log("mask == null");
            }
            if (item.Id == this.m_lBeastIdCurrent)
            {
                this.IsSelected = !flag;
                this.RefreshTip(item.Id);
                if (!flag && !Singleton <RoomManager> .singleton.IsObserver)
                {
                    this.ShowSkinSelect();
                }
            }
        }
    }
示例#13
0
    /// <summary>
    /// 显示普通模式的选择神兽列表
    /// </summary>
    private void ShowNormalBeasts()
    {
        if (base.Prepared)
        {
            bool isShowFreeBeast = Singleton <RoomManager> .singleton.IsShowFreeBeast;
            this.m_listActiveBeastId.Clear();
            List <DataBeastBook> data = GameData <DataBeastBook> .dataMap.Values.ToList <DataBeastBook>();

            int index = 1;
            int j     = 0;
            while (j < data.Count)
            {
                int beastId = data[j].BeastId;
                if (Singleton <RoomManager> .singleton.IsObserver || Singleton <PlayerRole> .singleton.IsBeastActive(beastId, false, isShowFreeBeast))
                {
                    IXUIListItem item;
                    if (index < base.uiBehaviour.m_BeastList.Count)
                    {
                        item = base.uiBehaviour.m_BeastList.GetItemByIndex(index);
                    }
                    else
                    {
                        item = base.uiBehaviour.m_BeastList.AddListItem();
                    }
                    if (item != null)
                    {
                        DataBeastlist dataBeastList = GameData <DataBeastlist> .dataMap[beastId];
                        if (dataBeastList != null)
                        {
                            IXUISprite sprite = item.GetUIObject("Week") as IXUISprite;
                            if (sprite != null)
                            {
                                bool flag = Singleton <PlayerRole> .singleton.IsFreeBeast(beastId);

                                sprite.SetVisible(flag && isShowFreeBeast);
                                if (flag)
                                {
                                    sprite.SetSprite("10");
                                }
                            }
                            item.SetVisible(true);
                            IXUISprite icon = item.GetUIObject("Icon") as IXUISprite;
                            icon.SetSprite(dataBeastList.IconFile, UIManager.singleton.GetAtlasName(EnumAtlasType.Beast, dataBeastList.IconFile));
                            item.TipParam = new TipParam
                            {
                                Tip = dataBeastList.Name
                            };

                            item.Id = (long)dataBeastList.ID;
                            item.RegisterMouseOnEventHandler(new MouseOnEventHandler(this.BeastListMouseOn));
                            this.m_listActiveBeastId.Add(beastId);
                        }
                        else
                        {
                            item.SetVisible(false);
                        }
                        index++;
                    }
                }
                j++;
            }
            //是否神兽列表多余,就隐藏
            while (index < base.uiBehaviour.m_BeastList.Count)
            {
                IXUIListItem item = base.uiBehaviour.m_BeastList.GetItemByIndex(index);
                item.SetVisible(false);
                index++;
            }
        }
    }
示例#14
0
 public void OnBoxClick(IXUISprite sp)
 {
     XSingleton <XUpdater> .singleton.OnRetry();
 }
示例#15
0
 private void ShowRoles()
 {
     if (base.Prepared)
     {
         int i     = 0;
         int index = 0;
         while (i < m_lCharacterList.Count)
         {
             CharacterInfo characterInfo = m_lCharacterList[i];
             int           roleId        = characterInfo.PlayerIndex;
             Debug.Log(roleId);
             IXUIListItem item;
             if (index < base.uiBehaviour.m_List_RoleList.Count)
             {
                 item = base.uiBehaviour.m_List_RoleList.GetItemByIndex(index);
             }
             else
             {
                 item = base.uiBehaviour.m_List_RoleList.AddListItem();
             }
             if (item != null)
             {
                 DataPlayerList dataRoleList = GameData <DataPlayerList> .dataMap[roleId];
                 if (dataRoleList != null)
                 {
                     IXUILabel nameLabel = item.GetUIObject("name/nameLabel") as IXUILabel;
                     if (nameLabel != null)
                     {
                         Debug.Log(characterInfo.Name);
                         nameLabel.SetText("Lv." + characterInfo.Level + "  " + characterInfo.Name + "\n" + dataRoleList.Name);
                     }
                     else
                     {
                         Debug.Log("Label == null");
                     }
                     IXUISprite icon = item.GetUIObject("Icon") as IXUISprite;
                     if (icon != null)
                     {
                         icon.SetSprite(dataRoleList.IconFile);
                     }
                     else
                     {
                         Debug.Log("Icon == null");
                     }
                     item.SetVisible(true);
                     item.Id = characterInfo.PlayerId;
                 }
                 else
                 {
                     item.SetVisible(false);
                 }
                 index++;
             }
             else
             {
                 Debug.Log("Item == null");
             }
             i++;
         }
     }
 }
示例#16
0
        public void SetupPool(GameObject parent, GameObject tpl, uint Count, bool bEffectiveMode = true)
        {
            this._pool.Clear();
            this._used.Clear();
            this._ToBeRemoved.Clear();
            this._tpl            = tpl;
            this._bEffectiveMode = bEffectiveMode;
            this._ActiveCount    = 0;
            IXUISprite iXUISprite = this._tpl.GetComponent("XUISprite") as IXUISprite;
            IXUILabel  iXUILabel  = this._tpl.GetComponent("XUILabel") as IXUILabel;

            if (iXUISprite != null)
            {
                this.TplWidth  = iXUISprite.spriteWidth;
                this.TplHeight = iXUISprite.spriteHeight;
            }
            else if (iXUILabel != null)
            {
                this.TplWidth  = iXUILabel.spriteWidth;
                this.TplHeight = iXUILabel.spriteHeight;
            }
            else
            {
                this.TplWidth  = 0;
                this.TplHeight = 0;
            }
            if (!bEffectiveMode)
            {
                this.ReturnAllDisable();
            }
            this.TplPos = this._tpl.transform.localPosition;
            Transform parent2 = (parent == null) ? this._tpl.transform.parent : parent.transform;
            int       num     = 0;

            while ((long)num < (long)((ulong)Count))
            {
                GameObject gameObject = UnityEngine.Object.Instantiate(this._tpl) as GameObject;
                gameObject.transform.parent     = parent2;
                gameObject.transform.localScale = Vector3.one;
                gameObject.name = "item" + num;
                if (this._bEffectiveMode)
                {
                    gameObject.transform.localPosition = Vector3.one * (float)XUIPool._far_far_away;
                }
                else
                {
                    gameObject.transform.localPosition = this._tpl.transform.localPosition;
                    this.MakeGameObjectEnabled(gameObject, false);
                }
                this._pool.Add(gameObject);
                this._used.Add(false);
                num++;
            }
            if (this._bEffectiveMode)
            {
                this._tpl.transform.parent        = parent2;
                this._tpl.transform.localPosition = Vector3.one * (float)XUIPool._far_far_away;
                return;
            }
            this._tpl.transform.parent = parent2;
            this.MakeGameObjectEnabled(this._tpl, false);
        }