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); }
protected override void InitUiOnAwake() { text = GameTool.GetTheChildComponent <Text>(this.gameObject, "Text"); MessageCenter.AddListener_Multparam(EMessageType.LoadingUI, SetTips); MessageCenter.AddListener(EMessageType.LoadingScene, LoadScene); }
private void InitAudio() { //初始化的时候,去获取音源组件 audioSource = GameTool.GetTheChildComponent <AudioSource>(this.gameObject, "AudioManager"); if (!GameTool.HasKey("AudioValue")) { GameTool.SetFloat("AudioValue", 0.5f); audioValue = 0.5f; } else { audioValue = GameTool.GetFloat("AudioValue"); audioSource.volume = audioValue; } if (!GameTool.HasKey("Mute")) { GameTool.SetString("Mute", "false"); isMute = false; } else { isMute = bool.Parse(GameTool.GetString("Mute")); audioSource.mute = isMute; } }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); slider_Progress = GameTool.GetTheChildComponent <Slider>(this.gameObject, "Slider_Progress"); txt_Progress = GameTool.GetTheChildComponent <Text>(this.gameObject, "Txt_Progress"); slider_Progress.onValueChanged.AddListener(ShowProgress); }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); backBtn = GameTool.GetTheChildComponent <Button>(gameObject, "BackBtn"); backBtn.onClick.AddListener(ToBackClick); rangeList = GameTool.FindTheChild(gameObject, "Range"); }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); startBtn = GameTool.GetTheChildComponent <Button>(gameObject, "StartBtn"); rangeBtn = GameTool.GetTheChildComponent <Button>(gameObject, "RankBtn"); settingBtn = GameTool.GetTheChildComponent <Button>(gameObject, "SettingBtn"); exitBtn = GameTool.GetTheChildComponent <Button>(gameObject, "EndBtn"); }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); btn_Close = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Close"); txt_NoticeDetails = GameTool.GetTheChildComponent <Text>(this.gameObject, "Txt_NoticeDetails"); btn_Close.onClick.AddListener(Close); ShowNotice(); }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); r2rImg = GameTool.GetTheChildComponent <RawImage>(gameObject, "r2"); r2btn = GameTool.GetTheChildComponent <Button>(gameObject, "r2"); r1rImg = GameTool.GetTheChildComponent <RawImage>(gameObject, "r1"); r1btn = GameTool.GetTheChildComponent <Button>(gameObject, "r1"); }
protected override void OnEnable() { //每次进入场景时重新更新一次UI //倒计时相关 timeDown = 10; txt_Time = GameTool.GetTheChildComponent <Text>(this.gameObject, "Txt_Time"); txt_Time.text = "" + timeDown; InvokeRepeating("Time_count", 1.0f, 1.0F); }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); txt_CoinCount = GameTool.GetTheChildComponent <Text>(this.gameObject, "Txt_CoinCount"); txt_RedCount = GameTool.GetTheChildComponent <Text>(this.gameObject, "Txt_RedCount"); txt_CoinCount.text = InforData.Instance.GetCoinCount().ToString(); txt_RedCount.text = InforData.Instance.GetRedCount().ToString(); MessageCenter.AddMessageListener(E_MessageType.ItemBeSell, AddCoin); }
// Use this for initialization protected override void Start() { btn_Pass = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Pass"); btn_Pass.onClick.AddListener(PassLevel); txt_CoinCount = GameTool.GetTheChildComponent <Text>(this.gameObject, "Txt_CoinCount"); txt_CoinCount.text = InforData.Instance.GetCoinCount().ToString(); MessageCenter.AddMessageListener(E_MessageType.getCoin, getCoin); }
protected override void InitUiOnAwake() { BtnBack = GameTool.GetTheChildComponent <Button>(this.gameObject, "BtnBack"); BtnBack.onClick.AddListener(OnBackBtnClick); BtnBackGame = GameTool.GetTheChildComponent <Button>(this.gameObject, "BtnBackGame"); BtnBackGame.onClick.AddListener(OnBtnBackGame); BtnQuit = GameTool.GetTheChildComponent <Button>(this.gameObject, "BtnQuit"); BtnQuit.onClick.AddListener(OnBtnQuit); }
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>(); }
protected override void InitUiOnAwake() { BtnBack = GameTool.GetTheChildComponent <Button>(this.gameObject, "BtnBack"); BtnBack.onClick.AddListener(OnBackBtnClick); Title = GameTool.GetTheChildComponent <Text>(gameObject, "Title"); Rank = GameTool.GetTheChildComponent <Text>(gameObject, "Rank"); Result = GameTool.GetTheChildComponent <Text>(gameObject, "Result"); MessageCenter.AddListener_Multparam(EMessageType.FinishUI, SetData); }
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 InitUiOnAwake() { base.InitUiOnAwake(); btn_Close = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Close"); slider_AudioValue = GameTool.GetTheChildComponent <Slider>(this.gameObject, "Slider_AudioValue"); btn_Close.onClick.AddListener(Close); slider_AudioValue.onValueChanged.AddListener(ChangeAudio); toggle_Mute = GameTool.GetTheChildComponent <Toggle>(this.gameObject, "Toggle_Mute"); toggle_Mute.onValueChanged.AddListener(ChangeMute); }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); btn_Exit = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Exit"); btn_Exit.onClick.AddListener(ShowExitPanel); btn_Pass = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Pass"); btn_NoPass = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_NoPass"); btn_Pass.onClick.AddListener(PassLevel); btn_NoPass.onClick.AddListener(NoPassLevel); }
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(); }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); btn_Close = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Close"); btn_Main = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Main"); btn_Level = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Level"); btn_Pack = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Pack"); btn_Close.onClick.AddListener(Close); btn_Main.onClick.AddListener(ShowMainPanel); btn_Level.onClick.AddListener(ShowLevelPanel); btn_Pack.onClick.AddListener(ShowPackPanel); }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); btn_Main = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Main"); btn_Level = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Level"); btn_Pack = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Pack"); btn_Main.onClick.AddListener(ShowMainPanel); btn_Level.onClick.AddListener(ShowLevelPanel); btn_Pack.onClick.AddListener(ShowPackPanel); MessageCenter.SendMessage(E_MessageType.Stop); }
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(); }
protected override void InitUiOnAwake() { Btn_Leave = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Leave"); Btn_Leave.onClick.AddListener(LeaveRoom); Btn_Prepare = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Prepare"); Btn_Start = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Start"); Btn_Start.onClick.AddListener(RequestStartGame); MemberList = GameTool.GetTheChildComponent <ScrollRect>(this.gameObject, "MemberList"); NetworkManager.AddEventListener("GetRoomInfo", GetRoomInfo); NetworkManager.AddEventListener("StartGame", OnStartGameBack); }
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"); }
protected override void InitUiOnAwake() { randomName = new RandomName(); randomName.LoadRandomNameData(); Btn_RandomName = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_RandomName"); Btn_RandomName.onClick.AddListener(SetPlayerName); Btn_Login = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Login"); Btn_Login.onClick.AddListener(StartGame); inputField = GameTool.GetTheChildComponent <InputField>(this.gameObject, "InputField"); inputField.text = randomName.GetRandomName(); clientConf = MeaninglessJson.LoadJsonFromFile <ClientConf>(MeaninglessJson.Path_StreamingAssets + "ClientConf.json"); }
protected override void InitUiOnAwake() { Btn_RandomName = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_RandomName"); Btn_Login = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Login"); Img_Weapon1 = GameTool.GetTheChildComponent <Image>(this.gameObject, "Img_Weapon1"); Img_Weapon2 = GameTool.GetTheChildComponent <Image>(this.gameObject, "Img_Weapon2"); Img_Skill1 = GameTool.GetTheChildComponent <Image>(this.gameObject, "Img_Skill1"); Img_Skill2 = GameTool.GetTheChildComponent <Image>(this.gameObject, "Img_Skill2"); Img_FrontSight = GameTool.GetTheChildComponent <Image>(this.gameObject, "Img_FrontSight"); Btn_Close = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Close"); Btn_Create = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Create"); Btn_Refresh = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Refresh"); Btn_Leave = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Leave"); Btn_Prepare = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Prepare"); Btn_Start = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Start"); Btn_OK = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_OK"); }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); highText = GameTool.GetTheChildComponent <Text>(gameObject, "HighText"); instance = this; stopBtn = GameTool.GetTheChildComponent <Button>(gameObject, "StopBtn"); backBtn = GameTool.GetTheChildComponent <Button>(gameObject, "BackBtn"); goOnBtn = GameTool.GetTheChildComponent <Button>(gameObject, "GoOnBtn"); stopWindow = GameTool.FindTheChild(gameObject, "StopWindow").gameObject; backBtn2 = GameTool.GetTheChildComponent <Button>(gameObject, "BackToMenuBtn"); returnBtn = GameTool.GetTheChildComponent <Button>(gameObject, "ReturnBtn"); sourceText = GameTool.GetTheChildComponent <Text>(gameObject, "SourceText"); endWindow = GameTool.FindTheChild(gameObject, "EndWindow").gameObject; }
protected override void OnEnable() { if (content.childCount == 0) { return; } int current = LevelManager.Instance.GetCurrentMaxLevel(); Debug.Log("当前开启的最高关卡时" + current); for (int i = 1; i < content.childCount + 1; i++) { if (i <= current) { GameObject levelItem = content.GetChild(i - 1).gameObject; GameTool.GetTheChildComponent <Button>(levelItem, "Btn_Level").enabled = true; GameTool.GetTheChildComponent <Image>(levelItem, "Btn_Level").color = Color.white; } } }
private void InitLevel() { int levelCount = DataController.Instance.GetCfgCount(DataController.Instance.dicLevel); PerfitWidth(levelCount); //获取当前可进入的最高级关卡 int currentLevel = LevelManager.Instance.GetCurrentMaxLevel(); GameObject levelItem = null; for (int i = 1; i < 16; i++) { if (i % 2 == 0) { //下 levelItem = Instantiate(levelItemDown); } else { //上 levelItem = Instantiate(levelItemUp); } //打卡对应的关卡 if (i <= currentLevel) { //可进入的关卡 GameTool.GetTheChildComponent <Image>(levelItem, "Btn_Level").color = Color.white; } else { //不可进入的关卡 GameTool.GetTheChildComponent <Button>(levelItem, "Btn_Level").enabled = false; } levelItem.AddComponent <LevelEntity>().levelId = i; //通过配置表获取关卡名称 string levelName = DataController.Instance.ReadCfg("LevelName", i, DataController.Instance.dicLevel); GameTool.GetTheChildComponent <Text>(levelItem, "Txt_LevelName").text = levelName; GameTool.GetTheChildComponent <Text>(levelItem, "Txt_LevelId").text = i.ToString(); GameTool.AddChildToParent(content, levelItem.transform); } levelItem = null; scrollView.AddComponent <ChangePage>(); }
protected override void InitUiOnAwake() { Img_PickUpTip = GameTool.GetTheChildComponent <Image>(this.gameObject, "PickUpTip"); Img_Weapon1 = GameTool.GetTheChildComponent <Image>(this.gameObject, "Img_Weapon1"); Img_Weapon2 = GameTool.GetTheChildComponent <Image>(this.gameObject, "Img_Weapon2"); Img_Skill1 = GameTool.GetTheChildComponent <Image>(this.gameObject, "Img_Skill1"); Img_Skill2 = GameTool.GetTheChildComponent <Image>(this.gameObject, "Img_Skill2"); Img_Skill1_Mask = GameTool.GetTheChildComponent <Image>(Img_Skill1.gameObject, "Ing_Skill1_Mask"); Img_Skill2_Mask = GameTool.GetTheChildComponent <Image>(Img_Skill2.gameObject, "Ing_Skill2_Mask"); Img_Shield = GameTool.GetTheChildComponent <Image>(this.gameObject, "Img_Shield"); Img_FrontSight = GameTool.GetTheChildComponent <Image>(gameObject, "Img_FrontSight"); Text_Skill1_Count = GameTool.GetTheChildComponent <Text>(this.gameObject, "Text_Count3"); Text_Skill2_Count = GameTool.GetTheChildComponent <Text>(this.gameObject, "Text_Count4"); Slider_HP = GameTool.GetTheChildComponent <Slider>(this.gameObject, "Slider"); Text_Remain = GameTool.GetTheChildComponent <Text>(this.gameObject, "Text_Remain"); Text_Time = GameTool.GetTheChildComponent <Text>(gameObject, "TextTime"); MessageCenter.AddListener(EMessageType.FoundItem, AwakePickUpTip); MessageCenter.AddListener(EMessageType.CurrentHP, UpdateHP); MessageCenter.AddListener(EMessageType.Remain, (object obj) => { Text_Remain.text = "" + (int)obj; }); }
protected override void InitUiOnAwake() { base.InitUiOnAwake(); btn_Exit = GameTool.GetTheChildComponent <Button>(this.gameObject, "Btn_Exit"); btn_Exit.onClick.AddListener(ShowExitPanel); MessageCenter.AddMessageListener(E_MessageType.Pass, Pass); txt_CoinCount = GameTool.GetTheChildComponent <Text>(this.gameObject, "Txt_CoinCount"); txt_CoinCount.text = InforData.Instance.GetCoinCount().ToString(); MessageCenter.AddMessageListener(E_MessageType.getCoin, AddCoin); //倒计时相关 //timeDown = 10; //txt_Time = GameTool.GetTheChildComponent<Text>(this.gameObject, "Txt_Time"); //txt_Time.text = "" + timeDown; // InvokeRepeating("Time_count", 1.0f, 1.0F); //MessageCenter.AddMessageListener(E_MessageType.GameOver, notPass); }