void Awake() { panel = transform.Find("BG").gameObject; panelScale = panel.transform.localScale; NGUITools.AddWidgetCollider(transform.Find("Mask").gameObject); Common.AddClickListener(transform.Find("BG/GameObject").gameObject, Close); Common.AddClickListener(transform.Find("BG/Btn").gameObject, Close); NGUITools.AddWidgetCollider(transform.Find("BG/Slide/GameObject/GameObject").gameObject); NGUITools.AddWidgetCollider(transform.Find("BG/Slide/GameObject/GameObject/GameObject (1)/GameObject/GameObject (1)").gameObject); musicSlide = transform.Find("BG/Slide/GameObject").GetComponent <UISlider>(); musicOff = transform.Find("BG/Slide/GameObject (2)").gameObject; musicOn = transform.Find("BG/Slide/GameObject (1)").gameObject; NGUITools.AddWidgetCollider(transform.Find("BG/Slide (1)/GameObject/GameObject").gameObject); NGUITools.AddWidgetCollider(transform.Find("BG/Slide (1)/GameObject/GameObject/GameObject (1)/GameObject/GameObject (1)").gameObject); soundEffectSlide = transform.Find("BG/Slide (1)/GameObject").GetComponent <UISlider>(); soundEffectOff = transform.Find("BG/Slide (1)/GameObject (2)").gameObject; soundEffectOn = transform.Find("BG/Slide (1)/GameObject (1)").gameObject; shakeOff = transform.Find("BG/Slide (2)/GameObject/GameObject (1)").gameObject; shakeOn = transform.Find("BG/Slide (2)/GameObject/GameObject (2)").gameObject; Common.AddClickListener(transform.Find("BG/Slide (2)/GameObject/GameObject").gameObject, ShakeOff, false); Common.AddClickListener(transform.Find("BG/Slide (2)/GameObject/GameObject (3)").gameObject, ShakeOn, false); }
void Awake() { mActCard = transform.parent.parent.Find("ActCard").GetComponent <UIGrid>(); mCard = transform.parent.parent.Find("Card").GetComponent <UIGrid>(); mActLandlord = transform.parent.parent.Find("Buttons/Landlord").gameObject; mAct = transform.parent.parent.Find("Buttons/Act/Act").gameObject; mPass = transform.parent.parent.Find("Buttons/Act/Pass/Pass").gameObject; mPlay = transform.parent.parent.Find("Buttons/Act/play").gameObject; mPassLabel = transform.parent.parent.Find("Buttons/Act/Pass/Label").gameObject; mName = transform.Find("Name").GetComponent <UILabel>(); mScore = transform.Find("Score").GetComponent <UILabel>(); mLandlord = transform.Find("DealerText").gameObject; mTime = transform.Find("Time").gameObject; mTimeLabel = mTime.GetComponentInChildren <UILabel>(); Common.AddClickListener(mActLandlord.transform.Find("yes").gameObject, () => EventManage.Instance.Broadcast(EventEnum.combat, "landlord")); Common.AddClickListener(mActLandlord.transform.Find("no").gameObject, () => EventManage.Instance.Broadcast(EventEnum.combat, "unlandlord")); Common.AddClickListener(mPlay, Play); Common.AddClickListener(mPass, PassPlay); Common.AddClickListener(mAct.transform.Find("pass").gameObject, PassPlay); Common.AddClickListener(mAct.transform.Find("tips").gameObject, TipsPlay); Common.AddClickListener(mAct.transform.Find("play").gameObject, HitPlay); }
void Awake() { nickname = transform.Find("BG/TopLeft/bg/name").GetComponent <UILabel>(); score = transform.Find("BG/TopLeft/bg/zuanshi").GetComponent <UILabel>(); Common.AddClickListener(transform.Find("BG/TopRight/bg/caidanBtn").gameObject, () => EventManage.Instance.Broadcast(EventEnum.lobby, "set")); Common.AddClickListener(transform.Find("BG/Right/jiafangBtn").gameObject, () => EventManage.Instance.Broadcast(EventEnum.lobby, "combat")); Common.AddClickListener(transform.Find("BG/TopRight/bg/fenxiangBtn").gameObject, Common.CreateMessageBox); Common.AddClickListener(transform.Find("BG/TopRight/bg/zhanjiBtn").gameObject, Common.CreateMessageBox); Common.AddClickListener(transform.Find("BG/TopRight/bg/yaoqingmaBtn").gameObject, Common.CreateMessageBox); Common.AddClickListener(transform.Find("BG/Right/jianfangBtn").gameObject, Common.CreateMessageBox); Common.AddClickListener(transform.Find("BG/Right/xinxiBtn").gameObject, Common.CreateMessageBox); Common.AddClickListener(transform.Find("BG/Right/dailiBtn").gameObject, Common.CreateMessageBox); }
private void Awake() { titleLabel = transform.Find("Background/Title").GetComponent <UILabel>(); buttonLabel = transform.Find("Background/Button (1)/ButtonLabel").GetComponent <UILabel>(); panel = transform.Find("Background").gameObject; confirmButton = transform.Find("Background/Button").gameObject; confirmButtonLabel = transform.Find("Background/Button/ButtonLabel").GetComponent <UILabel>(); cancelButton = transform.Find("Background/Button (1)").gameObject; Common.AddClickListener(confirmButton, OnButtonClick); Common.AddClickListener(cancelButton, OnCancelButtonClick); NGUITools.AddWidgetCollider(transform.Find("Mask").gameObject); //Common.AddClickListener(transform.Find("Mask").gameObject, ()=> Common.PopupGameObject(panel, DestroySelf, false), false); }
void Awake() { accountView = transform.Find("Account").gameObject; Common.AddClickListener(transform.Find("BG/WX").gameObject, () => EventManage.Instance.Broadcast <string>(EventEnum.login, "wx")); Common.AddClickListener(transform.Find("BG/Test").gameObject, () => EventManage.Instance.Broadcast <string>(EventEnum.login, "user")); NGUITools.AddWidgetCollider(transform.Find("Account/Mask").gameObject); Common.AddClickListener(transform.Find("Account/BG/Close").gameObject, () => accountView.SetActive(false)); Common.AddClickListener(transform.Find("Account/BG/RegisterBtn").gameObject, () => EventManage.Instance.Broadcast <string>(EventEnum.login, "register")); Common.AddClickListener(transform.Find("Account/BG/LoginBtn").gameObject, () => EventManage.Instance.Broadcast <string>(EventEnum.login, "login")); accountInput = transform.Find("Account/BG/AccountInput/Text").GetComponent <UIInput>(); passwordInput = transform.Find("Account/BG/PasswordInput/Text").GetComponent <UIInput>(); }
void Awake() { mDetail = transform.Find("Detail").gameObject; Common.AddClickListener(mDetail, () => IsMenu(true)); mMenu = transform.Find("Menu").gameObject; Common.AddClickListener(mMenu.transform.Find("Setting").gameObject, Setting); Common.AddClickListener(mMenu.transform.Find("Leave").gameObject, Leave); NGUITools.AddWidgetCollider(mMenu.transform.Find("Mask (1)").gameObject); Common.AddClickListener(mMenu.transform.Find("Mask (1)").gameObject, () => IsMenu(false)); mCard3[0] = transform.Find("Card3").GetChild(0).gameObject.AddComponent <Card>(); mCard3[1] = transform.Find("Card3").GetChild(1).gameObject.AddComponent <Card>(); mCard3[2] = transform.Find("Card3").GetChild(2).gameObject.AddComponent <Card>(); mPlayer = transform.Find("Players/Player").gameObject.AddComponent <Player>(); mPlayerAI1 = transform.Find("Players/Player2").gameObject.AddComponent <PlayerAI>(); mPlayerAI2 = transform.Find("Players/Player1").gameObject.AddComponent <PlayerAI>(); mStartGame = transform.Find("Buttons/StartGame").gameObject; Common.AddClickListener(mStartGame, StartGame); }