private void Awake() { EventDelegate.Set(this.btn_mask.onClick, new EventDelegate.Callback(this.OnMaskBtnClick)); EventDelegate.Set(this.btn_back.onClick, new EventDelegate.Callback(this.OnBackBtnClick)); EventDelegate.Set(this.btn_friend.onClick, new EventDelegate.Callback(this.OnFriendBtnClick)); EventDelegate.Set(this.btn_add.onClick, new EventDelegate.Callback(this.OnAddBtnClick)); }
private void Awake() { EventDelegate.Set(this.btn_back.onClick, new EventDelegate.Callback(this.OnBackBtnClick)); EventDelegate.Set(this.btn_add_coin.onClick, new EventDelegate.Callback(this.OnAddCoinBtnClick)); EventDelegate.Set(this.btn_add_associator.onClick, new EventDelegate.Callback(this.OnAddAssociatorBtnClik)); EventDelegate.Set(this.tween_pos.onFinished, new EventDelegate.Callback(this.OnTweenPosCallbacck)); }
void Start() { for (int i = 0; i < ItemEquiplist.Length; i++) { if (ItemEquiplist[i] == null) { ItemEquiplist[i] = transform.FindChild("Equip" + (i + 1).ToString()).GetComponent <ItemEquip>(); } } advancedBtn = UnityUtil.FindCtrl <UIButton>(gameObject, "AdvancedBtn"); upgradeAllBtn = UnityUtil.FindCtrl <UIButton>(gameObject, "UpgradeAllBtn"); EventDelegate.Set(advancedBtn.onClick, OnAdvancedBtnClick); EventDelegate.Set(upgradeAllBtn.onClick, OnUpgradeAllBtnClick); if (EquipOperation.Instance() != null) { EquipOperation.Instance().RefreshUI(1, ItemEquiplist[0]); } //EquipOperation.Instance().RefreshUI(1, ItemEquiplist[0]); //for (int i = 0; i < ItemEquiplist.Length; i++) //{ // //Debug.Log(ItemEquiplist[i].itemVO.props_id); //} if (jinjieEffect != null) { if (jinjieEffect.gameObject.activeSelf) { jinjieEffect.gameObject.SetActive(false); } } }
public override void Init(object[] data) { base.Init(data); string username = data[0].ToString(); int cachedSeconds = 0; if (lastRequestTime.HasValue) { cachedSeconds = (int)Utils.CurrentTime().Subtract((DateTime)lastRequestTime).TotalSeconds; } // Cached user and request user is the same -> show instantly if (user != null && user.GetString("username") == username && cachedSeconds <= CACHE_USER_SECONDS) { Utils.SetActive(userInfoPanel, true); DisplayUserInfo(user); } else { Utils.SetActive(userInfoPanel, false); // Loading user info from server PopupManager.Instance.ShowLoadingIndicator(); UserExtensionRequest.Instance.LoadUserInfo(username); } EventDelegate.Set(btnAddFriend.onClick, EventAddFriend); }
protected override void OnActive(bool active) { if (active) { if (input) { input.onClick = OnInputClick; UICamera.selectedObject = input.gameObject; } else { UICamera.selectedObject = music.gameObject; } if (graphics) { graphics.onClick = OnGraphicsClick; } //music.onClick = OnMusicClick; //sound.onClick = OnSoundClick; back.onClick = OnBack; if (exitToMainMenu) { exitToMainMenu.onClick = OnExitToMainMenuClick; } RefreshInfo(); EventDelegate.Set(mMusicSlider.onChange, OnMusicValueChange); EventDelegate.Set(mSoundSlider.onChange, OnSoundValueChange); } else { if (input) { input.onClick = null; } if (graphics) { graphics.onClick = null; } //music.onClick = null; //sound.onClick = null; back.onClick = null; if (exitToMainMenu) { exitToMainMenu.onClick = null; } EventDelegate.Remove(mMusicSlider.onChange, OnMusicValueChange); EventDelegate.Remove(mSoundSlider.onChange, OnSoundValueChange); } }
public static void Init() { for (int j = 1; j < (int)ServerType.ServerTypeCount; j++) { ServerType type = (ServerType)j; waitingMessages[type] = new Dictionary <long, NetworkWaitingItem>(); maskCounters[type] = 0; displayWaitingMasks[type] = false; displayErrorMasks[type] = false; } root = GameObject.Find("Boot/GlobalUI/NetworkWarning"); waitResponseMaskTrans = root.transform.Find("WarningMask"); waitResponseMaskTrans.gameObject.SetActive(false); maskTips = waitResponseMaskTrans.Find("Label").GetComponent <UILabel>(); btn_OK = waitResponseMaskTrans.Find("btn_OK").GetComponent <UIButton>(); btn_OK.gameObject.SetActive(false); btn_Continue = waitResponseMaskTrans.Find("btn_Continue").GetComponent <UIButton>(); btn_Continue.gameObject.SetActive(false); EventDelegate.Set(btn_OK.onClick, OnClickOK); EventDelegate.Set(btn_Continue.onClick, OnClickContinue); }
IEnumerator DelayCurMainQuest() { int whileCount = 5; while (0 < whileCount) { if (QuestManager.instance.GetCurrentQuestInfo() != null) { break; } yield return(new WaitForSeconds(0.1f)); --whileCount; } Debug.Log("Delay Current Main Quest "); QuestInfo curQuestInfo = QuestManager.instance.GetCurrentQuestInfo(); if (curQuestInfo != null) { CurMainQuestInfo.SetActive(true); SetMainItem(GridTf[0].GetChild(0), curQuestInfo);//메인 셋팅 EventDelegate.Set(GridTf[0].GetChild(0).GetComponent <UIEventTrigger>().onClick, delegate() { //SetMainDetailPopup(curQuestInfo); }); } else { GridTf[0].gameObject.SetActive(false); } yield return(null); }
public static GameObject Add(string name, string tooltip, byte[] png, Action <GameObject> action) { GameObject _Base = _SysShortcut.transform.Find("Base").gameObject; GameObject _Grid = _Base.transform.Find("Grid").gameObject; GameObject button = NGUITools.AddChild(_Grid, UTY.GetChildObject(_Grid, "Config", true)); button.name = name; EventDelegate.Set(button.GetComponent <UIButton>().onClick, () => { action(button); }); UIEventTrigger trigger = button.GetComponent <UIEventTrigger>(); EventDelegate.Set(trigger.onHoverOver, () => { VisibleExplanationRaw(tooltip); }); EventDelegate.Set(trigger.onHoverOut, () => { _SysShortcut.VisibleExplanation(null, false); }); EventDelegate.Set(trigger.onDragStart, () => { _SysShortcut.VisibleExplanation(null, false); }); UISprite sprite = button.GetComponent <UISprite>(); sprite.type = UIBasicSprite.Type.Filled; sprite.fillAmount = 0.0f; Texture2D texture = new Texture2D(1, 1); texture.LoadImage(png); UITexture uitexture = NGUITools.AddWidget <UITexture>(button); uitexture.material = new Material(uitexture.shader); uitexture.material.mainTexture = texture; uitexture.MakePixelPerfect(); repositionButtons(); return(button); }
/// <summary> /// item初始化函数 /// </summary> protected override void InitItem() { //初始化 icon = transform.Find("Icon").GetComponent <GUISingleButton>(); icon.onClick = OnIconClick; border = transform.Find("Border").GetComponent <UISprite>(); //qualityLabel = transform.Find("QualityLabel").GetComponent<UILabel>(); levelLabel = transform.Find("LevelLabel").GetComponent <UILabel>(); nameLabel = transform.Find("NameLabel").GetComponent <UILabel>(); play = transform.FindComponent <UISprite>("Play"); mask = UnityUtil.FindCtrl <UISprite>(gameObject, "Mask"); typeS = UnityUtil.FindCtrl <UISprite>(gameObject, "Type"); suo = UnityUtil.FindCtrl <UISprite>(gameObject, "Suo"); souStoneL = UnityUtil.FindCtrl <UILabel>(gameObject, "SouStoneL"); summonBtn = UnityUtil.FindCtrl <UIButton>(gameObject, "SummonBtn"); for (int i = 1; i <= 5; i++) { startList.Add(transform.Find("Star" + i).GetComponent <UISprite>()); } //EventDelegate.Set(mask.onClick, this.OnMackBtn); GetComponent <BoxCollider>().enabled = false; play.enabled = false; herolist = UIHeroList.instance; EventDelegate.Set(summonBtn.onClick, OnSummonBtnClick); }
private void Awake() { for (int i = 0; i < this.btn_SelectBetNum.Length; i++) { this.SetButtonCallBack(this.btn_SelectBetNum[i], new Action <int>(this.OnSelectBetNumClick), i); } EventDelegate.Set(this.btn_bufan.onClick, new EventDelegate.Callback(this.OnBuFanBtnClick)); EventDelegate.Set(this.btn_fanZhuang.onClick, new EventDelegate.Callback(this.OnFanZhuangBtnClick)); EventDelegate.Set(this.btn_shangZhuang.onClick, new EventDelegate.Callback(this.OnShangZhuangBtnClick)); EventDelegate.Set(this.btn_tongZhuang.onClick, new EventDelegate.Callback(this.OnTongZhuangBtnClick)); EventDelegate.Set(this.btn_xiaZhuang.onClick, new EventDelegate.Callback(this.OnXiaZhuangBtnClick)); EventDelegate.Set(this.btn_dice.onClick, new EventDelegate.Callback(this.OnDiceBtnClick)); EventDelegate.Set(this.btn_back.onClick, new EventDelegate.Callback(this.OnBackBtnClick)); EventDelegate.Set(this.btn_setting.onClick, new EventDelegate.Callback(this.OnSettingBtnClick)); EventDelegate.Set(this.btn_lookPlayer.onClick, new EventDelegate.Callback(this.OnPangGuangBtnClick)); EventDelegate.Set(this.btn_standUp.onClick, new EventDelegate.Callback(this.OnStandUpBtnClick)); EventDelegate.Set(this.btn_changeTable.onClick, new EventDelegate.Callback(this.OnChangeTableBtnClick)); EventDelegate.Set(this.btn_FengZhuang.onChange, new EventDelegate.Callback(this.OnFengZhuangBtnClick)); EventDelegate.Set(this.btn_openFriend.onClick, new EventDelegate.Callback(this.OnOpenFriendBtnClick)); EventDelegate.Set(this.btn_gameChat.onClick, new EventDelegate.Callback(this.OnGameChatBtnClick)); EventDelegate.Set(this.pic_bankerTip.GetComponent <TweenScale>().onFinished, delegate { this.pic_bankerTip.gameObject.SetActive(false); }); EventDelegate.Set(this.btn.onClick, new EventDelegate.Callback(this.OnBtnClick)); }
/* protected - Override & Unity API */ protected override void OnAwake() { base.OnAwake(); _pUITweenGroupPlay = GetComponent <CNGUITweenPlayGroup>(); UIButton[] arrButton = GetComponentsInChildren <UIButton>(); int iLen_Button = arrButton.Length; if (iLen_Button > 0) { _pListener = GetComponentInParent <IOnClickItemListener>(); if (_pListener == null) { DebugCustom.Log_ForCore(EDebugFilterDefault.Error_Core, "부모 오브젝트가 IOnClickItemListener 인터페이스를 상속 받아야합니다."); return; } } else { return; } for (int i = 0; i < iLen_Button; i++) { UIButton pUIButton = arrButton[i]; EventDelegate.Set(pUIButton.onClick, new EventDelegate(this, "OnClick_Item", pUIButton.name)); } }
private void SetBtnCallback(UIButton btn, Action <int> callback, int index) { EventDelegate.Set(btn.onClick, delegate { callback(index); }); }
void Start() { bgmMG = GameObject.Find("BGMManager"); effectMg = GameObject.Find("EffectManager"); muMg = bgmMG.GetComponent <MusicManager>(); efMg = effectMg.GetComponent <EffectSoundManager>(); UIButton bguib = gameObject.AddComponent <UIButton>(); if (bguib.gameObject.name == "BgmPlus") { bguib.tweenTarget = GameObject.Find("BgmPlus"); EventDelegate.Set(bguib.onClick, muMg.BgmPlus); } if (bguib.gameObject.name == "BgmMinus") { bguib.tweenTarget = GameObject.Find("BgmMinus"); EventDelegate.Set(bguib.onClick, muMg.BgmMinus); } if (bguib.gameObject.name == "EffectPlus") { bguib.tweenTarget = GameObject.Find("EffectPlus"); EventDelegate.Set(bguib.onClick, efMg.EffectPlus); } if (bguib.gameObject.name == "EffectMinus") { bguib.tweenTarget = GameObject.Find("EffectMinus"); EventDelegate.Set(bguib.onClick, efMg.EffectMinus); } }
private void Awake() { Panel_Tips.Instance = this; EventDelegate.Set(this.btn_tipBar_confirm.onClick, new EventDelegate.Callback(this.OnTipBarConfimBtnClick)); EventDelegate.Set(this.btn_confirmBar_confirm.onClick, new EventDelegate.Callback(this.OnConfirmBarConfirmClick)); EventDelegate.Set(this.btn_confirmBar_cancle.onClick, new EventDelegate.Callback(this.OnConfirmBarCancleClick)); }
public void Hide(bool animation) { base.enabled = false; mTransform_Arrows[0].SetActive(isActive: false); mTransform_Arrows[1].SetActive(isActive: false); mTransform_Arrows[2].SetActive(isActive: false); mTransform_Arrows[3].SetActive(isActive: false); mTransform_Arrows[4].SetActive(isActive: false); camera.SetActive(isActive: false); if (animation) { animating = true; TweenScale.Begin(base.gameObject, 0.3f, hideScale); TweenAlpha tweenAlpha = TweenAlpha.Begin(base.gameObject, 0.3f, 0f); EventDelegate.Set(tweenAlpha.onFinished, delegate { animating = false; }); } else { mUIWidgetThis.alpha = 0.001f; } PopupString.enabled = true; }
public override void Init() { base.Init(); LowMgr = _LowDataMgr.instance; UserInfo = NetData.instance.GetUserInfo(); EventDelegate.Set(transform.FindChild("BtnClose").GetComponent <UIButton>().onClick, Close); EventDelegate.Set(transform.FindChild("BtnApply").GetComponent <UIButton>().onClick, delegate() { if (0 < SelectTitleL && (UserInfo._LeftTitle == 0 ? 1 : UserInfo._LeftTitle) != SelectTitleL) { NetworkClient.instance.SendPMsgUseTitleC(SelectTitleL == 1 ? UserInfo._LeftTitle : SelectTitleL, SelectTitleL != 1); } if (0 < SelectTitleR && (UserInfo._RightTitle == 0 ? 2 : UserInfo._RightTitle) != SelectTitleR) { NetworkClient.instance.SendPMsgUseTitleC(SelectTitleR == 2 ? UserInfo._RightTitle : SelectTitleR, SelectTitleR != 2); } //Close(); }); EventDelegate.Set(GetCondition.gameObject.GetComponent <UIEventTrigger>().onClick, OnClickAchievLink); //LeftGrid.GetChild(0).gameObject.SetActive(false); //RightGrid.GetChild(0).gameObject.SetActive(false); }
public void InitToggleData(UILabel label, List <string> textList, float toggleTime = 1f, float waitTime = 1f, bool spriteReset = true) { if (label == null || textList.Count == 0) { return; } TweenAlpha component = label.gameObject.GetComponent <TweenAlpha>(); if (component == null) { this.m_tweenAlpha.Add(label.gameObject.AddComponent <TweenAlpha>()); } else { this.m_tweenAlpha.Remove(component); UnityEngine.Object.Destroy(component); this.m_tweenAlpha.Add(label.gameObject.AddComponent <TweenAlpha>()); } for (int i = 0; i < this.m_tweenAlpha.Count; i++) { this.m_tweenAlpha[i].enabled = false; } if (spriteReset && this.m_toggleSprite != null) { TweenAlpha component2 = this.m_toggleSprite.gameObject.GetComponent <TweenAlpha>(); if (component2 != null) { this.m_tweenAlpha.Remove(component2); UnityEngine.Object.Destroy(component2); } this.m_toggleSprite.alpha = 1f; this.m_toggleSprite = null; } this.m_toggleTextList = textList; this.m_waitTime = waitTime; this.m_toggleTime = toggleTime; this.m_toggleLabel = label; this.m_counter = 0; if (this.m_labelColorList != null && this.m_labelColorList.Count > 0) { this.m_toggleLabel.color = this.m_labelColorList[0]; } if (this.m_effectColorList != null && this.m_effectColorList.Count > 0) { this.m_toggleLabel.effectColor = this.m_effectColorList[0]; } this.m_toggleLabel.text = this.m_toggleTextList[0]; this.m_toggleLabel.alpha = 0f; for (int j = 0; j < this.m_tweenAlpha.Count; j++) { this.m_tweenAlpha[j].from = 0f; this.m_tweenAlpha[j].to = 1f; this.m_tweenAlpha[j].style = UITweener.Style.Once; this.m_tweenAlpha[j].duration = this.m_toggleTime; this.m_tweenAlpha[j].animationCurve = this.m_animaCurve; this.m_tweenAlpha[j].tweenFactor = 0f; } EventDelegate.Set(this.m_tweenAlpha[0].onFinished, new EventDelegate.Callback(this.FadeInAnimaEnd)); base.StartCoroutine(this.PlayTweenStart()); }
public override void Init(object[] data) { base.Init(data); gameType = (BaseGameScreen.GameType)data[0]; EventDelegate.Set(btnConfirm.onClick, EventLeaveGame); EventDelegate.Set(btnCancel.onClick, Close); }
void Start() { instance = this; OneBtnUpgrade.onClick = OneBtnUpgradeClick; BtnUpgrade.onClick = BtnUpgradeClick; EventDelegate.Set(SoulStoneIcon.onClick, OnsoulStoneIconClick); }
public void Hide(bool animation) { base.set_enabled(false); this.mTransform_Arrows[0].SetActive(false); this.mTransform_Arrows[1].SetActive(false); this.mTransform_Arrows[2].SetActive(false); this.mTransform_Arrows[3].SetActive(false); this.mTransform_Arrows[4].SetActive(false); this.camera.SetActive(false); if (animation) { this.animating = true; TweenScale.Begin(base.get_gameObject(), 0.3f, this.hideScale); TweenAlpha tweenAlpha = TweenAlpha.Begin(base.get_gameObject(), 0.3f, 0f); EventDelegate.Set(tweenAlpha.onFinished, delegate { this.animating = false; }); } else { this.mUIWidgetThis.alpha = 0.001f; } this.PopupString.set_enabled(true); }
public void Start() { slider = GetComponent <UISlider>(); if (isGameDurationSlider) { minValue = 0; maxValue = (availableDurations.Length - 1); slider.numberOfSteps = availableDurations.Length; } else if (isRoundAmountSlider) { minValue = 0; maxValue = (availableRoundCounts.Length - 1); slider.numberOfSteps = availableRoundCounts.Length; } else if (isIdleTimerSlider) { minValue = 0; maxValue = (availableIdleLimit.Length - 1); slider.numberOfSteps = availableIdleLimit.Length; } else if (isGammaSlider) { EventDelegate newEvent = new EventDelegate(); newEvent.Set(this, "OnSliderChange"); slider.onChange.Add(newEvent); slider.numberOfSteps = Mathf.RoundToInt((maxValue - minValue) / 0.01f) + 1; } InitializeValues(); }
public override void Init() { base.Init(); IsCallReward = false; EventDelegate.Set(ContinueBtn.onClick, Close); }
void SkillInit() { for (int i = 0; i < SkillIcon.Length; i++) { GameObject selectEff = SkillIcon[i].transform.parent.transform.FindChild("Selecteff").gameObject; selectEff.SetActive(false); } //액티브 스킬 셋팅 Dictionary <ushort, NetData._PartnerActiveSkillData> activeSkillList = CurData.ActiveSkillList; int activeCount = activeSkillList.Count; for (int i = 1; i < activeCount; i++)//0번은 평타. { uint skillId = activeSkillList[(ushort)i]._skillIndex; SkillTables.ActionInfo actionLowData = _LowDataMgr.instance.GetSkillActionLowData(skillId); if (actionLowData == null) { continue; } SkillIcon[i - 1].spriteName = _LowDataMgr.instance.GetLowDataIcon(actionLowData.Icon); SkillName[i - 1].text = _LowDataMgr.instance.GetStringSkillName(actionLowData.name); SkillLevel[i - 1].text = string.Format(_LowDataMgr.instance.GetStringCommon(1151), CurData.GetBuffSkillToSlot((ushort)i)._skillLevel); int idx = i; EventDelegate.Set(ActiveSkillTrigger[i - 1].onClick, delegate() { OnClickActiveSkill(idx - 1, activeSkillList[(ushort)idx]); }); //SkillDesc[i - 1].text = _LowDataMgr.instance.GetStringSkillName(actionLowData.descrpition); } //디폴트는 첫번째스킬 OnClickActiveSkill(0, activeSkillList[1]); }
public void Alpha(float _fTime, float _fAlpha) { TweenAlpha ta = TweenAlphaAll(gameObject, _fTime, _fAlpha); m_bEndTween = false; EventDelegate.Set(ta.onFinished, EndTween); }
void Start() { EventDelegate.Set(btn_start_user.onClick, () => { On_Start_Username_Click(); }); EventDelegate.Set(btn_start_server.onClick, () => { On_Start_Server_Click(); }); EventDelegate.Set(btn_start_enter.onClick, () => { On_Start_Enter_Click(); }); EventDelegate.Set(btn_login_login.onClick, () => { On_Login_login_Click(); }); EventDelegate.Set(btn_login_reg.onClick, () => { On_Login_reg_Click(); }); EventDelegate.Set(btn_login_close.onClick, () => { On_Login_close_Click(); }); EventDelegate.Set(btn_reg_cancel.onClick, () => { On_Reg_cancel_Click(); }); EventDelegate.Set(btn_reg_reg.onClick, () => { On_Reg_reg_Click(); }); EventDelegate.Set(btn_reg_close.onClick, () => { On_Reg_close_Click(); }); EventDelegate.Set(btn_server_selected.onClick, () => { On_server_selected_Click(); }); EventDelegate.Set(btn_select_return.onClick, () => { On_select_return_Click(); }); EventDelegate.Set(btn_select_change.onClick, () => { On_select_change_Click(); }); EventDelegate.Set(btn_selectshow_sure.onClick, () => { On_selectedshow_sure_click(); }); EventDelegate.Set(btn_selectshow_back.onClick, () => { On_selectedshow_back_Clik(); }); if (instance == null) { instance = this; } login = this.GetComponent <LoginController>(); register = this.GetComponent <RegisterController>(); roleControll = this.GetComponent <RoleController>(); roleControll.OnGetRole += this.OnGetRole; roleControll.OnGetEmptyRole += this.OnGetEmptyRole; roleControll.OnAddRole += this.OnAddRole; roleControll.OnseletRole += this.OnSelectRole; }
void Start() { UIEventListener.Get(maskBtn.gameObject).onClick = OnMaskBtnClick; UIEventListener.Get(damageMaskBtn.gameObject).onClick = OnDamageBtnClick; EventDelegate.Set(ConfirmBtn.onClick, OnConfirmBtnClick); }
public virtual void BaseInit() { if (btnClose != null) { EventDelegate.Set(btnClose.onClick, Close); } }
void Awake() { task = transform.Find("task").GetComponent <UIButton>(); skill = transform.Find("skill").GetComponent <UIButton>(); bag = transform.Find("bag").GetComponent <UIButton>(); combat = transform.Find("combat").GetComponent <UIButton>(); shop = transform.Find("shop").GetComponent <UIButton>(); system = transform.Find("system").GetComponent <UIButton>(); EventDelegate tasked = new EventDelegate(this, "OnTask"); task.onClick.Add(tasked); EventDelegate skilled = new EventDelegate(this, "OnSkill"); skill.onClick.Add(skilled); EventDelegate baged = new EventDelegate(this, "OnBag"); bag.onClick.Add(baged); EventDelegate.Set(combat.onClick, () => { OnCombat(); }); EventDelegate.Set(shop.onClick, () => { OnShop(); }); EventDelegate.Set(system.onClick, () => { OnSystem(); }); }
public override void OnCreate() { base.OnCreate(); m_levelNumber = GetChildComponent <NumberDrawer>("LevelNumber"); m_totalCostNumber = GetChildComponent <NumberDrawer>("ItemTotalCost"); m_stageIcon = GetChildComponent <UISprite>("StageIcon"); m_stageInfoLabel = GetChildComponent <UILabel>("StageInfoLabel"); for (int i = 0; i < 3; ++i) { m_itemCostLabels[i] = GetChildComponent <UILabel>("Item" + (i + 1).ToString() + "Cost"); m_itemToggles[i] = GetChildComponent <UIToggle>("Item" + (i + 1).ToString() + "Btn"); m_itemToggles[i].SetWithoutTrigger(false); m_lockItemSprite[i] = GetChildComponent <UISprite>("LockItem" + (i + 1).ToString()); m_background[i] = GetChildComponent <UISprite>("Background" + (i + 1).ToString()); EventDelegate.Set(m_itemToggles[i].onChange, OnToggle); } m_playBtn = UIToolkits.FindChild(mUIObject.transform, "PlayBtn").gameObject; m_playPayCoinBtn = UIToolkits.FindChild(mUIObject.transform, "PlayPlayCoinBtn").gameObject; m_itemBoard = UIToolkits.FindChild(mUIObject.transform, "Board").gameObject; m_itemBoardWithArrow = UIToolkits.FindChild(mUIObject.transform, "BoardWithArrow").gameObject; AddChildComponentMouseClick("CloseBtn", OnCloseClicked); AddChildComponentMouseClick("PlayBtn", OnPlayClicked); AddChildComponentMouseClick("PlayPlayCoinBtn", OnPlayClicked); }
public void Awake() { desLabel = transform.Find("DesLabel").GetComponent <UILabel>(); energyLabel = transform.Find("EnergyLabel").GetComponent <UILabel>(); energyTitleLabel = transform.Find("EnergyTitleLabel").GetComponent <UILabel>(); btnsignleEnter = transform.Find("BtnSignleEnter").GetComponent <UIButton>(); btnteamEnter = transform.Find("BtnTeamEnter").GetComponent <UIButton>(); btnClose = transform.Find("BtnClose").GetComponent <UIButton>(); tween = transform.GetComponent <TweenScale>(); //注册按钮点击事件 EventDelegate ed1 = new EventDelegate(this, "OnSignleEnter"); btnsignleEnter.onClick.Add(ed1); EventDelegate ed2 = new EventDelegate(this, "OnClose"); btnClose.onClick.Add(ed2); EventDelegate.Set(btnteamEnter.onClick, () => { OnteamEnter(); }); battleController = GameManger._instance.GetComponent <BattleController>(); battleController.OnGetTeam += this.OnGetTeam; battleController.OnWaitTeam += this.OnWaitTeam; battleController.OnCancelTeam += this.OnCancelTeam; }