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 }
public override void Init() { base.Init(); #region 我方的神兽列表 this.m_ourBeastList = base.GetUIObject("Beasts/OurBeasts") as IXUIList; #endregion #region 敌方的神兽列表 this.m_enmeyBeastList = base.GetUIObject("Beasts/EnemyBeasts") as IXUIList; #endregion #region 择神兽列表 this.m_BeastList = base.GetUIObject("Beasts/SelectBeastBack/BeastBg/Beastlist") as IXUIList; #endregion #region 确定选择按钮 this.m_Button_Confirm = base.GetUIObject("Beasts/SureButton") as IXUIButton; #endregion #region 提示lebel this.m_Label_Tips = base.GetUIObject("Beasts/RoomTip") as IXUILabel; #endregion #region 时间倒计时 this.m_Label_Time = base.GetUIObject("Beasts/Time") as IXUILabel; #endregion #region 聊天文本 this.m_TextList_Chat = base.GetUIObject("Beasts/ChatWindow/ChatTextList") as IXUITextList; #endregion }
public override void Init() { base.Init(); this.m_Button_Cancel = base.GetUIObject("Cancel") as IXUIButton; this.m_Label_TimeYuJi = base.GetUIObject("YujiTime/YujiTimeLabel") as IXUILabel; if (this.m_Label_TimeYuJi == null) { Debug.Log("this.m_Label_TimeYuJi == null"); } this.m_Label_TimeInfact = base.GetUIObject("InfactTime/InfactLabel") as IXUILabel; }
/// <summary> /// 根据id取得Label,设置文字内容 /// </summary> /// <param name="strId">UI的id</param> /// <param name="strText">文字</param> /// <returns></returns> public bool SetText(string strId, string strText) { IXUILabel iXUILabel = this.GetUIObject(strId) as IXUILabel; if (iXUILabel != null) { iXUILabel.SetText(strText); return(true); } return(false); }
public override void Init() { base.Init(); this.m_Button_Enter = (base.GetUIObject("bt_entergame") as IXUIButton); if (null == this.m_Button_Enter) { Debug.Log("Button_Enter is null!"); this.m_Button_Enter = WidgetFactory.CreateWidget <IXUIButton>(); } this.m_Label_Ver = (base.GetUIObject("lb_version") as IXUILabel); if (null == this.m_Label_Ver) { Debug.Log("Anchor/Label_Ver is null!"); this.m_Label_Ver = WidgetFactory.CreateWidget <IXUILabel>(); } /*this.m_Group_Input = (base.GetUIObject("Scale/Group_Input") as IXUIGroup); * if (null == this.m_Group_Input) * { * Debug.Log("Group_Input is null!"); * this.m_Group_Input = WidgetFactory.CreateWidget<IXUIGroup>(); * } */ this.m_Checkbox_Remember = (base.GetUIObject("sp_input_bg/cb_remenber") as IXUICheckBox); if (null == this.m_Checkbox_Remember) { Debug.Log("Checkbox_Remember is null!"); this.m_Checkbox_Remember = WidgetFactory.CreateWidget <IXUICheckBox>(); } this.m_Label_Register = (base.GetUIObject("sp_input_bg/bt_regist") as IXUIButton); if (null == this.m_Label_Register) { Debug.Log("Group_Input/Account/Label_Register is null!"); this.m_Label_Register = WidgetFactory.CreateWidget <IXUIButton>(); } this.m_Label_Forget = (base.GetUIObject("sp_input_bg/bt_forget") as IXUIButton); if (null == this.m_Label_Forget) { Debug.Log("Group_Input/Account/Label_Forget is null!"); this.m_Label_Forget = WidgetFactory.CreateWidget <IXUIButton>(); } this.m_Input_ID = (base.GetUIObject("sp_input_bg/ip_username") as IXUIInput); if (null == this.m_Input_ID) { Debug.Log("Group_Input/Input_ID is null!"); this.m_Input_ID = WidgetFactory.CreateWidget <IXUIInput>(); } this.m_Input_PW = (base.GetUIObject("sp_input_bg/ip_password") as IXUIInput); if (null == this.m_Input_PW) { Debug.Log("Group_Input/Input_PW is null!"); this.m_Input_PW = WidgetFactory.CreateWidget <IXUIInput>(); } }
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 }
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>(); } }
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 }
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); }
private void RefreshPlayerInfo(IXUIListItem uiListItem, PlayerData playerData, BeastData beast, ECampType eCampType) { if (beast != null) { this.SetSelectBeastId(beast.Id, beast.BeastTypeId); Debug.Log("Our BeastId:" + beast.Id); if (playerData != null && uiListItem != null) { uiListItem.Clear(); IXUILabel label = uiListItem.GetUIObject("Label_PlayerName") as IXUILabel; if (label != null) { label.SetText(playerData.Name); } if (Singleton <RoomManager> .singleton.MathMode != EnumMathMode.EnumMathMode_Story) { uiListItem.SetText("Label_Sequence", GetSequence(eCampType, uiListItem.Index).ToString()); } this.RefreshPlayerInfo(uiListItem, beast); } } }
public void RefreshSkill(EnumSkillType type, int skillId) { List <SkillGameData> skills = Singleton <BeastRole> .singleton.Beast.Skills; for (int i = 0; i < skills.Count; i++) { SkillGameData skillData = skills[i]; if (skillId == skillData.Id) { if (skillId == 1) { //this.uiBehaviour.m_Button_Attack.SetEnable(skillData.CDTime <= 0); return; } switch (skillData.SkillType) { case 0: IXUILabel cdq = base.uiBehaviour.m_Sprite_SkillQ.GetUIObject("lb_skillQ_cd") as IXUILabel; if (skillData.CDTime > 0) { cdq.SetText(skillData.CDTime.ToString()); cdq.SetVisible(true); this.uiBehaviour.m_Sprite_SkillQ.SetEnable(false); } else { cdq.SetVisible(false); this.uiBehaviour.m_Sprite_SkillQ.SetEnable(true); } break; case 1: IXUILabel cdw = base.uiBehaviour.m_Button_SkillW.GetUIObject("lb_skillW_cd") as IXUILabel; if (skillData.CDTime > 0) { cdw.SetText(skillData.CDTime.ToString()); cdw.SetVisible(true); base.uiBehaviour.m_Button_SkillW.SetEnable(false); } else { cdw.SetVisible(false); base.uiBehaviour.m_Button_SkillW.SetEnable(true); } break; case 2: IXUILabel cde = base.uiBehaviour.m_Button_SkillE.GetUIObject("lb_skillE_cd") as IXUILabel; if (skillData.CDTime > 0) { cde.SetText(skillData.CDTime.ToString()); cde.SetVisible(true); base.uiBehaviour.m_Sprite_SkillE.SetEnable(false); } else { cde.SetVisible(false); base.uiBehaviour.m_Sprite_SkillE.SetEnable(true); } break; case 3: IXUILabel cdr = base.uiBehaviour.m_Sprite_SkillR.GetUIObject("lb_skillR_cd") as IXUILabel; if (cdr != null && skillData.CDTime > 0) { cdr.SetText(skillData.CDTime.ToString()); cdr.SetVisible(true); base.uiBehaviour.m_Sprite_SkillR.SetEnable(false); } else { cdr.SetVisible(false); base.uiBehaviour.m_Sprite_SkillR.SetEnable(true); } break; case 4: break; case 5: break; } } } }
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++; } } }
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); }