private void AddRoomListItem(int index, int PlayerNum, int RoomStatus) { GameObject gobj = Instantiate(RoomListItem) as GameObject; gobj.transform.SetParent(RoomList.content); Text Text_RoomName = GameTool.FindTheChild(gobj, "RoomName").GetComponent <Text>(); Text Text_MemberCount = GameTool.FindTheChild(gobj, "MemberCount").GetComponent <Text>(); Text Text_Status = GameTool.FindTheChild(gobj, "Status").GetComponent <Text>(); Text_RoomName.text = "房间号" + index.ToString(); Text_MemberCount.text = PlayerNum.ToString() + " / 10"; if (RoomStatus == 0) { Text_Status.text = "准备中"; } else { Text_Status.text = "游玩中"; } gobj.GetComponent <MainUIRoomListItem>().DoubleClickEvent.AddListener(() => { JoinRoom(index); }); }
public override void Act(BaseFSM FSM) { if (BagManager.Instance.skillAttributesList[0].skillInfo != BagManager.Instance.NullInfo) { if (BagManager.Instance.skillAttributesList[0].skillInfo.magicProperties.magicType == MagicType.HeartAttack) { if (BagManager.Instance.skillAttributesList[0].isOn) { BagManager.Instance.UseMagic(0); FSM.PlayAnimation("Magic Shoot Attack"); //GameObject go = NetPoolManager.Instantiate("Heart Attack", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, FSM.transform.rotation); NetworkManager.SendPlayerMagic("Heart Attack", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, Look(FSM)); AudioManager.PlaySound2D("HeartAttack").Play(); //go.GetComponent<MagicBehaviour>().isHit = true; //NetworkManager.SendPlayerMagic("Heart Attack", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, FSM.transform.rotation); } } } if (BagManager.Instance.skillAttributesList[1].skillInfo != BagManager.Instance.NullInfo) { if (BagManager.Instance.skillAttributesList[1].skillInfo.magicProperties.magicType == MagicType.HeartAttack) { if (BagManager.Instance.skillAttributesList[1].isOn) { BagManager.Instance.UseMagic(1); FSM.PlayAnimation("Magic Shoot Attack"); //GameObject go = NetPoolManager.Instantiate("Heart Attack", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, FSM.transform.rotation); NetworkManager.SendPlayerMagic("Heart Attack", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, Look(FSM)); AudioManager.PlaySound2D("HeartAttack").Play(); //go.GetComponent<MagicBehaviour>().isHit = true; //NetworkManager.SendPlayerMagic("Heart Attack", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, FSM.transform.rotation); } } } }
protected override void InitUiOnAwake() { Btn_Close = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Close"); scrollRect = GameTool.GetTheChildComponent <ScrollRect>(this.gameObject, "BagList"); equipScrollRect = GameTool.GetTheChildComponent <ScrollRect>(this.gameObject, "EquipList"); /**/ HeadSlot = GameTool.GetTheChildComponent <Image>(GameTool.FindTheChild(this.gameObject, "HeadSlot").gameObject, "Image"); HeadGem1 = GameTool.GetTheChildComponent <Image>(GameTool.FindTheChild(this.gameObject, "HeadGem1").gameObject, "Image"); HeadGem2 = GameTool.GetTheChildComponent <Image>(GameTool.FindTheChild(this.gameObject, "HeadGem2").gameObject, "Image"); BodySlot = GameTool.GetTheChildComponent <Image>(GameTool.FindTheChild(this.gameObject, "BodySlot").gameObject, "Image"); BodyGem1 = GameTool.GetTheChildComponent <Image>(GameTool.FindTheChild(this.gameObject, "BodyGem1").gameObject, "Image"); BodyGem2 = GameTool.GetTheChildComponent <Image>(GameTool.FindTheChild(this.gameObject, "BodyGem2").gameObject, "Image"); WeaponSlot1 = GameTool.GetTheChildComponent <Image>(GameTool.FindTheChild(this.gameObject, "WeaponSlot1").gameObject, "Image"); Weapon1Gem1 = GameTool.GetTheChildComponent <Image>(GameTool.FindTheChild(this.gameObject, "Weapon1Gem1").gameObject, "Image"); Weapon1Gem2 = GameTool.GetTheChildComponent <Image>(GameTool.FindTheChild(this.gameObject, "Weapon1Gem2").gameObject, "Image"); WeaponSlot2 = GameTool.GetTheChildComponent <Image>(GameTool.FindTheChild(this.gameObject, "WeaponSlot2").gameObject, "Image"); Weapon2Gem1 = GameTool.GetTheChildComponent <Image>(GameTool.FindTheChild(this.gameObject, "Weapon2Gem1").gameObject, "Image"); Weapon2Gem2 = GameTool.GetTheChildComponent <Image>(GameTool.FindTheChild(this.gameObject, "Weapon2Gem2").gameObject, "Image"); Magic1 = GameTool.GetTheChildComponent <Image>(GameTool.FindTheChild(this.gameObject, "MagicSlot1").gameObject, "Image"); Magic2 = GameTool.GetTheChildComponent <Image>(GameTool.FindTheChild(this.gameObject, "MagicSlot2").gameObject, "Image"); Btn_Close.onClick.AddListener(CloseBagUI); BagItem = new List <GameObject>(); EquipItem = new List <GameObject>(); MessageCenter.AddListener(EMessageType.RefreshBagList, RefreshBagList); }
private void GetBuff(BuffType buff, CharacterStatus status) { ; Material buffMat = Resources.Load("Debuff/" + buff.ToString()) as Material; switch (buff) { case BuffType.SlowDown: if (buffMat != null) { GameTool.FindTheChild(gameObject, "Base").GetComponent <SkinnedMeshRenderer>().material = buffMat; } status.moveSpeed *= 0.7f; break; case BuffType.Freeze: if (buffMat != null) { GameTool.FindTheChild(gameObject, "Base").GetComponent <SkinnedMeshRenderer>().material = buffMat; } status.moveSpeed *= 0.001f; break; case BuffType.Blind: Camera.main.GetComponent <BlindEffect>().enabled = true; break; } }
protected override void InitUIOnAwake() { base.InitUIOnAwake(); content = GameTool.FindTheChild(gameObject, "Bg/Content").GetComponent <Text>(); confirmBtn = GameTool.FindTheChild(gameObject, "Bg/Confirm").GetComponent <Button>(); confirmBtn.onClick.AddListener(() => { MessageDispatcher.Dispatch(MessagesType.HideErrorView); }); }
public override void Act(BaseFSM FSM) { //MessageCenter.AddListener(EMessageType.GetHitPoint, (object obj) => { hitpoint = (Vector3)obj; }); if (BagManager.Instance.skillAttributesList[0].skillInfo != BagManager.Instance.NullInfo) { if (BagManager.Instance.skillAttributesList[0].skillInfo.magicProperties.magicType == MagicType.Thunderbolt) { if (BagManager.Instance.skillAttributesList[0].isOn) { BagManager.Instance.UseMagic(0); GameObject go = NetPoolManager.Instantiate("ThunderBolt", FSM.transform.position + FSM.transform.forward * 5, FSM.transform.rotation); AudioManager.PlaySound2D("ThunderBolt").Play(); go.GetComponent <MagicBehaviour>().isHit = true; NetworkManager.SendPlayerMagic("ThunderBolt", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, FSM.transform.rotation); } } } if (BagManager.Instance.skillAttributesList[1].skillInfo != BagManager.Instance.NullInfo) { if (BagManager.Instance.skillAttributesList[1].skillInfo.magicProperties.magicType == MagicType.Thunderbolt) { if (BagManager.Instance.skillAttributesList[1].isOn) { BagManager.Instance.UseMagic(1); GameObject go = NetPoolManager.Instantiate("ThunderBolt", FSM.transform.position + FSM.transform.forward * 5, FSM.transform.rotation); AudioManager.PlaySound2D("ThunderBolt").Play(); go.GetComponent <MagicBehaviour>().isHit = true; NetworkManager.SendPlayerMagic("ThunderBolt", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, FSM.transform.rotation); } } } }
// Use this for initialization void Start() { image = GameTool.FindTheChild(gameObject, "Image").GetComponent <Image>(); MessageCenter.AddListener(Meaningless.EMessageType.GetBagListFull, (object obj) => { bagListFull = (bool)obj; }); cv = gameObject.transform.parent.gameObject; rectTransform = cv.transform as RectTransform; }
public override void Act(BaseFSM FSM) { if (BagManager.Instance.skillAttributesList[0].skillInfo != BagManager.Instance.NullInfo) { if (BagManager.Instance.skillAttributesList[0].skillInfo.magicProperties.magicType == MagicType.Ripple) { if (BagManager.Instance.skillAttributesList[0].isOn) { BagManager.Instance.UseMagic(0); FSM.PlayAnimation("Magic Shoot Attack"); AudioManager.PlaySound2D("Ripple").Play(); NetworkManager.SendPlayerMagic("Ripple", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, Look(FSM)); } } } if (BagManager.Instance.skillAttributesList[1].skillInfo != BagManager.Instance.NullInfo) { if (BagManager.Instance.skillAttributesList[1].skillInfo.magicProperties.magicType == MagicType.Ripple) { if (BagManager.Instance.skillAttributesList[1].isOn) { BagManager.Instance.UseMagic(1); FSM.PlayAnimation("Magic Shoot Attack"); AudioManager.PlaySound2D("Ripple").Play(); NetworkManager.SendPlayerMagic("Ripple", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, Look(FSM)); } } } }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); backBtn = GameTool.GetTheChildComponent <Button>(gameObject, "BackBtn"); backBtn.onClick.AddListener(ToBackClick); rangeList = GameTool.FindTheChild(gameObject, "Range"); }
protected override void Initialize() { Transform RigPelvis = GameTool.FindTheChild(gameObject, "RigPelvis"); LHand = GameTool.FindTheChild(RigPelvis.gameObject, "Dummy Prop Left"); RHand = GameTool.FindTheChild(RigPelvis.gameObject, "Dummy Prop Right"); Head = GameTool.FindTheChild(RigPelvis.gameObject, "Dummy Prop Head"); Wings = GameTool.FindTheChild(gameObject, "Wings"); }
/* * public void Equip(int itemID) * { * if (itemID != 0) * { * SingleItemInfo ItemInfo; * ItemInfo = ItemInfoManager.Instance.GetItemInfo(itemID); * switch (ItemInfo.itemType) * { * case ItemType.Armor: * switch (ItemInfo.armorProperties.armorType) * { * case ArmorType.NULL: * break; * case ArmorType.Head: * GameObject headRes = ResourcesManager.Instance.GetItem(ItemInfo.ItemName); * GameObject headObj = Instantiate(headRes, Head); * break; * case ArmorType.Body: * GameObject bodyObj = ResourcesManager.Instance.GetItem(ItemInfo.ItemName); * Material clothesMat = bodyObj.GetComponent<MeshRenderer>().sharedMaterial; * GameTool.FindTheChild(gameObject, "Base").GetComponent<SkinnedMeshRenderer>().material = clothesMat; * break; * } * break; * case ItemType.Weapon: * if (ItemInfo.weaponProperties.weaponType != WeaponType.Shield) * { * GameObject weaponRes = ResourcesManager.Instance.GetItem(ItemInfo.ItemName); * GameObject RWeapon = Instantiate(weaponRes, RHand); * RWeapon.transform.parent = RHand; * * if (ItemInfoManager.Instance.GetWeaponWeaponType(itemID) == WeaponType.DoubleHands) * { * GameObject LWeapon = Instantiate(weaponRes, LHand); * LWeapon.transform.parent = LHand; * } * * } * else * { * GameObject itemRes = ResourcesManager.Instance.GetItem(ItemInfo.ItemName); * GameObject Shield = Instantiate(itemRes, LHand); * Shield.transform.parent = LHand; * } * break; * } * } * } */ public void EquipClothes(int itemID) { string itemName = ItemInfoManager.Instance.GetResname(itemID); GameObject itemObj = ResourcesManager.Instance.GetItem(itemName); Material clothesMat = itemObj.GetComponent <MeshRenderer>().sharedMaterial; GameTool.FindTheChild(gameObject, "Base").GetComponent <SkinnedMeshRenderer>().material = clothesMat; }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); r3rImg = GameTool.GetTheChildComponent <RawImage>(gameObject, "r3"); r3btn = GameTool.GetTheChildComponent <Button>(gameObject, "r3"); go = GameTool.FindTheChild(gameObject, "GameObject"); rImgs = go.GetComponentsInChildren <RawImage>(); }
private void Awake() { levelText = GameTool.FindTheChild(gameObject, "levelText").gameObject.GetComponent <Text>(); coneText = GameTool.FindTheChild(gameObject, "coneText").gameObject.GetComponent <Text>(); currentExp = GameTool.FindTheChild(gameObject, "currentExp").gameObject.GetComponent <Text>(); fullExp = GameTool.FindTheChild(gameObject, "fullExp").gameObject.GetComponent <Text>(); addExp = GameTool.FindTheChild(gameObject, "addExp").gameObject.GetComponent <Button>(); addCone = GameTool.FindTheChild(gameObject, "addCone").gameObject.GetComponent <Button>(); }
private void Awake() { Timer = GameTool.FindTheChild(gameObject, "Timer").GetComponent <Text>(); SuccessButton = GameTool.FindTheChild(gameObject, "SuccessButton").gameObject; FailButton = GameTool.FindTheChild(gameObject, "FailButton").gameObject; ExitButton = GameTool.FindTheChild(gameObject, "ExitButton").gameObject; UGUIEventListener.Get(SuccessButton).onClick = SuccessButtonClick; UGUIEventListener.Get(FailButton).onClick = FailButtonClick; UGUIEventListener.Get(ExitButton).onClick = ExitButtonClick; }
protected override void InitUiOnAwake() { Btn_OK = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_OK"); Btn_OK.onClick.AddListener(OK); Text_Button = GameTool.GetTheChildComponent <Text>(GameTool.FindTheChild(this.gameObject, "Btn_OK").gameObject, "Text"); Text_Tips = GameTool.GetTheChildComponent <Text>(this.gameObject, "Text_Tips"); MessageCenter.AddListener_Multparam(EMessageType.TipsUI, SetTips); }
protected override void OnEnable() { base.OnEnable(); range = RangeManager.Instance.range; for (int i = 0; i < rangeList.childCount; i++) { Text rangeText = GameTool.FindTheChild(rangeList.GetChild(i).gameObject, "RangeHigh").GetComponent <Text>(); rangeText.text = range[i].ToString(); } }
void Awake() { levelRect = this.gameObject.GetComponent <ScrollRect>(); allToggle = GameTool.FindTheChild(this.transform.parent.gameObject, "AllToggle"); arrToggle = new Toggle[allToggle.childCount]; for (int i = 0; i < arrToggle.Length; i++) { arrToggle[i] = allToggle.GetChild(i).GetComponent <Toggle>(); arrToggle[i].onValueChanged.AddListener(OnChangePage); } }
void Start() { item = Resources.Load <GameObject>("Item"); box = Resources.Load <GameObject>("Box"); content = GameTool.FindTheChild(transform.parent.gameObject, "Content"); showImg = GameTool.FindTheChild(transform.root.gameObject, "InforImg").GetComponent <Image>(); showEffect = GameTool.FindTheChild(transform.root.gameObject, "InforEffect").GetComponent <Text>(); showCoin = GameTool.FindTheChild(transform.root.gameObject, "InforCoin").GetComponent <Text>(); checkbox = Instantiate(Resources.Load <GameObject>("CheckBox")).transform; checkbox.SetParent(this.transform.parent.Find("ObjectPool")); }
protected override void InitUIOnAwake() { base.InitUIOnAwake(); codeInput = GameTool.FindTheChild(gameObject, "CodeInput").GetComponent <InputField>(); activateBtn = GameTool.FindTheChild(gameObject, "Activite").GetComponent <Button>(); tipGo = GameTool.FindTheChild(gameObject, "TipsBg").GetComponent <Transform>(); tips = GameTool.FindTheChild(gameObject, "Tips").GetComponent <Text>(); tipGo.gameObject.SetActive(false); activateBtn.onClick.AddListener(SendActivitePost); }
protected override void InitUIData() { base.InitUIData(); barlist = new List <DeviceListBar>(); searchBtn = GameTool.FindTheChild(gameObject, "Search").GetComponent <Button>(); tipGo = GameTool.FindTheChild(gameObject, "TipsBg").GetComponent <Transform>(); tips = GameTool.FindTheChild(gameObject, "TipsBg/Tips").GetComponent <Text>(); tipGo.gameObject.SetActive(false); searchBtn.onClick.AddListener(Refresh); }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); scrollView = GameTool.FindTheChild(this.gameObject, "Scroll View").gameObject; btn_Return = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Return"); btn_Return.onClick.AddListener(ReturnUI); content = GameTool.FindTheChild(this.gameObject, "Content"); levelItemUp = Resources.Load <GameObject>("LevelPrefab/LevelItemUp"); levelItemDown = Resources.Load <GameObject>("LevelPrefab/LevelItemDown"); InitLevel(); }
private void Init() { BattleRes = GameTool.FindTheChild(gameObject, "BattleRes").gameObject; RoomList = GameTool.FindTheChild(gameObject, "RoomList").gameObject; CloseBtn = GameTool.FindTheChild(gameObject, "CloseButton").gameObject; RefreshButton = GameTool.FindTheChild(gameObject, "RefreshButton").gameObject; CreateRoomButton = GameTool.FindTheChild(gameObject, "CreateRoomButton").gameObject; Username = GameTool.FindTheChild(gameObject, "Username").GetComponent <Text>(); TotalCount = GameTool.FindTheChild(gameObject, "TotalCount").GetComponent <Text>(); WinCount = GameTool.FindTheChild(gameObject, "WinCount").GetComponent <Text>(); Layout = GameTool.FindTheChild(gameObject, "Layout").GetComponent <VerticalLayoutGroup>(); roomItem = Resources.Load("UIPrefabs/RoomItem") as GameObject; }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); btn_Pack = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Pack"); btn_Notice = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Notice"); btn_Set = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Set"); btn_Pack.onClick.AddListener(GotoPackPanel); btn_Notice.onClick.AddListener(GotoNoticePanel); btn_Set.onClick.AddListener(GotoSetPanel); noticeText = GameTool.FindTheChild(this.gameObject, "Txt_Notice"); content = GameTool.GetTheChildComponent <RectTransform>(this.gameObject, "Content"); JudgeFinishPs(); }
public void Init() { BluePanel = GameTool.FindTheChild(gameObject, "BluePanel").gameObject; RedPanel = GameTool.FindTheChild(gameObject, "RedPanel").gameObject; Blue_Username = GameTool.FindTheChild(gameObject, "Blue_Username").GetComponent <Text>(); Blue_TotalCount = GameTool.FindTheChild(gameObject, "Blue_TotalCount").GetComponent <Text>(); Blue_WinCount = GameTool.FindTheChild(gameObject, "Blue_WinCount").GetComponent <Text>(); Red_Username = GameTool.FindTheChild(gameObject, "Red_Username").GetComponent <Text>(); Red_TotalCount = GameTool.FindTheChild(gameObject, "Red_TotalCount").GetComponent <Text>(); Red_WinCount = GameTool.FindTheChild(gameObject, "Red_WinCount").GetComponent <Text>(); StartButton = GameTool.FindTheChild(gameObject, "StartButton").gameObject; ExitButton = GameTool.FindTheChild(gameObject, "ExitButton").gameObject; BtnGroup = GameTool.FindTheChild(gameObject, "BtnGroup").gameObject; }
private void InitUIManager()//初始化窗体 { canvas = this.transform.parent; //切换场景时画布不会被销毁 DontDestroyOnLoad(canvas); if (keepAboveUIRot == null) { keepAboveUIRot = GameTool.FindTheChild(canvas.gameObject, "KeepAboveUIRot"); } if (normalUIRoot == null) { normalUIRoot = GameTool.FindTheChild(canvas.gameObject, "NormalUIRoot"); } ShowUI(E_UIID.MainUi); }
private void Awake() { Username = GameTool.FindTheChild(gameObject, "UsernameInput").GetComponent <InputField>(); Password = GameTool.FindTheChild(gameObject, "PasswordInput").GetComponent <InputField>(); RepeatPassword = GameTool.FindTheChild(gameObject, "RePasswordInput").GetComponent <InputField>(); RegistBtn = GameTool.FindTheChild(gameObject, "RegisterButton").gameObject; CloseBtn = GameTool.FindTheChild(gameObject, "CloseButton").gameObject; UGUIEventListener.Get(RegistBtn).onClick += RegisterBtnClick; UGUIEventListener.Get(CloseBtn).onClick += CloseBtnClick; registerRequest = GetComponent <RegisterRequest>(); if (registerRequest == null) { registerRequest = gameObject.AddComponent <RegisterRequest>(); } }
public void Awake() { closeBtn = transform.Find("CloseButton").gameObject; closeBtn.GetComponent <Button>().onClick.AddListener(CloseBtnClick); usernameIF = GameTool.FindTheChild(gameObject, "UsernameInput").GetComponent <InputField>(); passworIF = GameTool.FindTheChild(gameObject, "PasswordInput").GetComponent <InputField>(); loginButton = GameTool.FindTheChild(gameObject, "LoginButton").GetComponent <Button>(); registerButton = GameTool.FindTheChild(gameObject, "RegisterButton").GetComponent <Button>(); loginRequset = GetComponent <LoginRequest>(); if (loginRequset == null) { loginRequset = gameObject.AddComponent <LoginRequest>(); } loginButton.onClick.AddListener(LoginButtonClick); registerButton.onClick.AddListener(RegisterButtonClick); }
//初始化UI管理类 private void InitUIManager() { canvas = this.transform.parent; //设置画布在场景切换的时候不被销毁,因为整个游戏共用唯一的一个画布 DontDestroyOnLoad(canvas); if (keepAboveUIRoot == null) { keepAboveUIRoot = GameTool.FindTheChild(canvas.gameObject, "KeepAboveUIRoot"); } if (normalUIRoot == null) { normalUIRoot = GameTool.FindTheChild(canvas.gameObject, "NormalUIRoot"); } // ShowUI(E_UiId.MainUI); //ShowUI(E_UiId.InforUI); }
private Quaternion Look(BaseFSM FSM) { //Ray ray = new Ray(GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, new Vector3(Screen.width / 2, Screen.height / 2, 0)); Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0)); RaycastHit hitInfo; Vector3 targetPoint; if (Physics.Raycast(ray, out hitInfo)) { targetPoint = hitInfo.point; } else { targetPoint = Camera.main.transform.forward * 100; } return Quaternion.LookRotation(targetPoint - GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position); }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); txt_Name = GameTool.GetTheChildComponent <Text>(this.gameObject, "Txt_Name"); txt_Price = GameTool.GetTheChildComponent <Text>(this.gameObject, "Txt_Price"); txt_Introduce = GameTool.GetTheChildComponent <Text>(this.gameObject, "Txt_Introduce"); img_Item = GameTool.GetTheChildComponent <Image>(this.gameObject, "Img_Item"); txt_BeChooseCount = GameTool.GetTheChildComponent <Text>(this.gameObject, "Txt_BeChooseCount"); //查找五个分类按钮 btn_All = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_All"); btn_Equipment = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Equipment"); btn_Potions = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Potions"); btn_Rune = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Rune"); btn_Material = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Material"); //五个分类按钮添加监听 btn_All.onClick.AddListener(ShowAllItem); btn_Equipment.onClick.AddListener(ShowEquipmentItem); btn_Potions.onClick.AddListener(ShowPotionsItem); btn_Rune.onClick.AddListener(ShowRuneItem); btn_Material.onClick.AddListener(ShowMaterialItem); inforBg = GameTool.FindTheChild(this.gameObject, "InforBg").gameObject; btn_Level = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Level"); btn_Return = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Return"); btn_Level.onClick.AddListener(GotoLevelPanel); btn_Return.onClick.AddListener(ReturnUI); itemPrefab = Resources.Load <GameObject>("ItemPrefab/Item"); content = GameTool.FindTheChild(this.gameObject, "Content"); MessageCenter.AddMessageListener(E_MessageType.ItemBeChoose, ShowItemInfor); inf_Count = GameTool.GetTheChildComponent <InputField>(this.gameObject, "Inf_Count"); // inf_ItemId = GameTool.GetTheChildComponent<InputField>(this.gameObject, "Inf_ItemId"); btn_Add = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Add"); btn_Minus = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Minus"); btn_Sure = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Sure"); btn_Cancel = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Cancel"); btn_Sell = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Sell"); sellPanel = GameTool.FindTheChild(this.gameObject, "SellBg").gameObject; btn_Add.onClick.AddListener(Add); btn_Minus.onClick.AddListener(Minus); btn_Sell.onClick.AddListener(ShowSellPanel); btn_Cancel.onClick.AddListener(HideSellPanel); btn_Sure.onClick.AddListener(SureSell); verticalSb = GameTool.GetTheChildComponent <Scrollbar>(this.gameObject, "Scrollbar Vertical"); }