private void initView() { titleLabel = FindInChild <UILabel>("left/titleLabel"); btn_close = FindInChild <Button>("left/btn_close"); btn_oneKeyExtract = FindInChild <Button>("left/BtnOneKeyExtract"); btn_oneKeyDel = FindInChild <Button>("left/BtnOneKeyDel"); btn_del = FindInChild <Button>("left/BtnDelete"); noMailListImage = NGUITools.FindChild(gameObject, "left/noMailList"); delCheckBox = NGUITools.FindInChild <UIToggle>(gameObject, "left/Checkbox"); delCheckBox.value = false; delCheckBox.SetActive(false); delCheckBox.onChange.Add(new EventDelegate(delCheckBoxOnClick)); mailViewTP = FindInChild <TweenPlay>("left"); scrollView = FindInChild <UIScrollView>("left/content"); mailItemGrid = FindInChild <UIGrid>("left/content/grid"); mailItemGrid.onReposition += scrollView.ResetPosition; mailItemContainerList = new List <ItemContainer>(); mailItem = NGUITools.FindChild(gameObject, "left/content/grid/item_0"); ItemContainer itemContainer = mailItem.AddMissingComponent <ItemContainer>(); mailItemContainerList.Add(itemContainer); mailItem.SetActive(false); }
public void Init(GameObject obj) { gameObject = obj; obj.SetActive(false); fbList = new List <GameObject>(); fbList.Add(NGUITools.FindChild(gameObject, "info/fb/1")); fbList.Add(NGUITools.FindChild(gameObject, "info/fb/2")); fbList.Add(NGUITools.FindChild(gameObject, "info/fb/3")); NGUITools.FindInChild <Button>(fbList[0], "").onClick = OnFbClick; NGUITools.FindInChild <Button>(fbList[1], "").onClick = OnFbClick; NGUITools.FindInChild <Button>(fbList[2], "").onClick = OnFbClick; close = false; play = NGUITools.FindInChild <TweenPlay>(gameObject, "info"); EventDelegate.Add(play.onFinished, Close); NGUITools.FindInChild <UIWidgetContainer>(gameObject, "background").onClick = OnCloseClick; OkButton = NGUITools.FindInChild <Button>(gameObject, "info/button"); OkButton.onClick = OnCloseClick; NGUITools.FindInChild <UISprite>(gameObject, "info/fb/current/icn").atlas = Singleton <PetView> .Instance.PropAltas; }
public void Init(GameObject obj) { gameObject = obj; obj.SetActive(false); name = NGUITools.FindInChild <UILabel>(gameObject, "info/name"); tips = NGUITools.FindInChild <UILabel>(gameObject, "info/tips"); CloseButton = NGUITools.FindInChild <Button>(gameObject, "info/button"); CloseButton.onClick = OnCloseClick; NGUITools.FindInChild <UIWidgetContainer>(gameObject, "background").onClick = OnCloseClick; light = NGUITools.FindChild(gameObject, "info/light"); tipsPlay = NGUITools.FindInChild <TweenPlay>(gameObject, "info"); EventDelegate.Add(tipsPlay.onFinished, CloseView); close = false; stars = new List <GameObject>(); GameObject star1 = NGUITools.FindChild(gameObject, "info/stars/1"); GameObject star2 = NGUITools.FindChild(gameObject, "info/stars/2"); GameObject star3 = NGUITools.FindChild(gameObject, "info/stars/3"); GameObject star4 = NGUITools.FindChild(gameObject, "info/stars/4"); GameObject star5 = NGUITools.FindChild(gameObject, "info/stars/5"); stars.Add(star1); stars.Add(star2); stars.Add(star3); stars.Add(star4); stars.Add(star5); starNum = 0; }
protected override void Init() { btn_left = FindInChild <Button>("view/btn_left"); btn_right = FindInChild <Button>("view/btn_right"); tweenPlay = FindInChild <UIPlayTween>(); equipTipsTP = FindInChild <TweenPlay>("view"); btn_close = FindInChild <Button>("view/btn_close"); background = FindInChild <UIWidgetContainer>("background"); background.clickDelegate = CloseView; //jiBenSX = FindInChild<UILabel>("view/jbsx/item/shuzi"); itemName = FindInChild <UILabel>("view/name"); itemLevel = FindInChild <UILabel>("view/level"); jobLabel = FindInChild <UILabel>("view/job"); goodsIcon = FindInChild <UIWidgetContainer>("view/item"); GetItemList(); btn_close.clickDelegate = CloseView; smeltLabel = FindInChild <UILabel>("view/smelttile"); smeltLabel.text = LanguageManager.GetWord("Tips.Smelt"); descLabel = FindInChild <UILabel>("view/ms/title"); fightpoint = FindInChild <UILabel>("view/fightpointvalue"); sprMask = FindInChild <UISprite>("background"); tweenPos = FindInChild <TweenPosition>("view"); fromOld = FindInChild <TweenPosition>("view").from; }
protected override void Init() { //transform.localScale = new Vector3(0.4f,0.4f,0.4f); play = FindInChild <TweenPlay>(); play.style = UITweener.Style.Loop; base.firstOpen = false; }
//private int refCount = 0; protected override void Init() { base.firstOpen = false; playTween = FindInChild <TweenPlay>("node/waiting"); playAlphas = FindInChild <TweenAlphas>("node"); base.closeTween = playAlphas; playAlphas.duration = 0.2f; playTween.style = UITweener.Style.PingPong; fillSprite = FindInChild <UISprite>("node/waiting/foreground"); }
protected override void Init() { InitLabel(); tweenShake = FindInChild <TweenShake>(); btn_close = FindInChild <Button>("btn_close"); goods.Add(FindInChild <Transform>("Awards/Goods/1")); goods.Add(FindInChild <Transform>("Awards/Goods/2")); goods.Add(FindInChild <Transform>("Awards/Goods/3")); goods.Add(FindInChild <Transform>("Awards/Goods/4")); goods.Add(FindInChild <Transform>("Awards/Goods/5")); lifeAchievement = FindInChild <UISprite>("Achievement/life"); timeAchievement = FindInChild <UISprite>("Achievement/time"); killAchievement = FindInChild <UISprite>("Achievement/kill"); recExpValue = FindInChild <UILabel>("Awards/Exp/value"); recMoneyValue = FindInChild <UILabel>("Awards/Money/value"); recSoulValue = FindInChild <UILabel>("Awards/Soul/value"); role = FindInChild <Transform>("Background/role"); star1 = FindChild("Achievement/Stars/star1"); star2 = FindChild("Achievement/Stars/star2"); star3 = FindChild("Achievement/Stars/star3"); Exp = FindChild("Awards/Exp"); Soul = FindChild("Awards/Soul"); Goods = FindChild("Awards/Goods"); Money = FindChild("Awards/Money"); expTween = FindInChild <TweenPosition>("Awards/Exp"); soulTween = FindInChild <TweenPosition>("Awards/Soul"); moneyTween = FindInChild <TweenPosition>("Awards/Money"); goodsTween = FindInChild <TweenPosition>("Awards/Goods"); star1Tween = FindInChild <TweenAlpha>("Achievement/Stars/star1"); star2Tween = FindInChild <TweenAlpha>("Achievement/Stars/star2"); star3Tween = FindInChild <TweenAlpha>("Achievement/Stars/star3"); playstar1 = FindInChild <TweenPlay>("Achievement/Stars/star1"); playstar2 = FindInChild <TweenPlay>("Achievement/Stars/star2"); playstar3 = FindInChild <TweenPlay>("Achievement/Stars/star3"); playExp = FindInChild <TweenPlay>("Awards/Exp"); playSoul = FindInChild <TweenPlay>("Awards/Soul"); playGoods = FindInChild <TweenPlay>("Awards/Goods"); playMoney = FindInChild <TweenPlay>("Awards/Money"); remainTimeValue = FindInChild <UILabel>("QuitCopy/value"); achievementPos.Add(timeAchievement.transform.localPosition); achievementPos.Add(lifeAchievement.transform.localPosition); achievementPos.Add(killAchievement.transform.localPosition); btn_close.onClick += CloseOnClick; for (int i = 0; i < goods.Count; ++i) { goods[i].GetComponent <Button>().onClick = GoodsOnClick; } }
private void initView() { btn_close = NGUITools.FindInChild <Button>(alertViewGameObject, "view/btn_close"); btn_comfirm = NGUITools.FindInChild <Button>(alertViewGameObject, "view/btn_comfirm"); icon = NGUITools.FindInChild <Transform>(alertViewGameObject, "view/topleft"); unitPriceIcon = NGUITools.FindInChild <Transform>(alertViewGameObject, "view/unitPrice"); currencryPriceIcon = NGUITools.FindInChild <Transform>(alertViewGameObject, "view/costPrice"); countValueInput = NGUITools.FindInChild <UIWidgetContainer>(alertViewGameObject, "view/input"); nameLabel = NGUITools.FindInChild <UILabel>(alertViewGameObject, "view/nameLabel"); levelLabel = NGUITools.FindInChild <UILabel>(alertViewGameObject, "view/levelLabel"); levelValueLabel = NGUITools.FindInChild <UILabel>(alertViewGameObject, "view/levelValueLabel"); descriptionLabel = NGUITools.FindInChild <UILabel>(alertViewGameObject, "view/descriptionLabel"); priceLabel = NGUITools.FindInChild <UILabel>(alertViewGameObject, "view/priceLabel"); priceValueLabel = NGUITools.FindInChild <UILabel>(alertViewGameObject, "view/priceValueLabel"); countLabel = NGUITools.FindInChild <UILabel>(alertViewGameObject, "view/countLabel"); countValueLabel = NGUITools.FindInChild <UILabel>(alertViewGameObject, "view/input/countValueLabel"); goldLabel = NGUITools.FindInChild <UILabel>(alertViewGameObject, "view/goldLabel"); goldValueLabel = NGUITools.FindInChild <UILabel>(alertViewGameObject, "view/goldValueLabel"); alterViewTP = NGUITools.FindInChild <TweenPlay>(alertViewGameObject, "view"); }
public void Init(GameObject obj) { gameObject = obj; obj.SetActive(false); rightObj = NGUITools.FindChild(gameObject, "info/right"); rightObjStartPos = rightObj.transform.localPosition; leftObj = NGUITools.FindChild(gameObject, "info/left"); leftObjStartPos = leftObj.transform.localPosition; rightPlay = NGUITools.FindInChild<TweenPlay>(rightObj, ""); leftPlay = NGUITools.FindInChild<TweenPlay>(leftObj, ""); openPlay = NGUITools.FindInChild<TweenPlay>(gameObject, "info"); NGUITools.FindInChild<UIWidgetContainer>(gameObject, "background").onClick = OnCloseClick; leftButton = NGUITools.FindChild(leftObj, "button"); rightButton = NGUITools.FindChild(rightObj, "button"); GuideLeftButton = leftButton.GetComponent<Button>(); NGUITools.FindInChild<UILabel>(leftButton, "name").text = "查看合成"; GuideLeftButton.onClick = OnLeftButtonClick; NGUITools.FindInChild<Button>(rightButton, "").onClick = OnRightButtonClick; NGUITools.FindInChild<UILabel>(rightButton, "name").text = "合成"; EventDelegate.Add(openPlay.onFinished, Close); //装备的按钮 equipIcn = NGUITools.FindInChild<UISprite>(leftObj, "icn"); equipIcn.atlas = Singleton<PetView>.Instance.EquipAltas; equipIcn.normalAtlas = Singleton<PetView>.Instance.EquipAltas; equipIcn.grayAtlas = Singleton<PetView>.Instance.EquipAltas_Gray; close = false; rightOpen = false; equipList = new List<SysEquipVo>(); topList = new List<GameObject>(); topList.Add(NGUITools.FindChild(rightObj,"top/1")); topList.Add(NGUITools.FindChild(rightObj, "top/2")); topList.Add(NGUITools.FindChild(rightObj, "top/3")); topList.Add(NGUITools.FindChild(rightObj, "top/4")); chose = NGUITools.FindChild(rightObj, "top/chose"); for (int i = 0; i < topList.Count; i++) { NGUITools.FindInChild<UISprite>(topList[i], "icn").atlas = Singleton<PetView>.Instance.EquipAltas; NGUITools.FindInChild<Button>(topList[i], "").onClick = OnTopEquipClick; } fbList = new List<GameObject>(); fbList.Add(NGUITools.FindChild(rightObj, "fb/1")); fbList.Add(NGUITools.FindChild(rightObj, "fb/2")); fbList.Add(NGUITools.FindChild(rightObj, "fb/3")); NGUITools.FindInChild<Button>(fbList[0], "").onClick = OnFbClick; NGUITools.FindInChild<Button>(fbList[1], "").onClick = OnFbClick; NGUITools.FindInChild<Button>(fbList[2], "").onClick = OnFbClick; hcList = new List<GameObject>(); hcList.Add(NGUITools.FindChild(rightObj, "hc/1")); hcList.Add(NGUITools.FindChild(rightObj, "hc/2")); hcList.Add(NGUITools.FindChild(rightObj, "hc/3")); NGUITools.FindInChild<UISprite>(hcList[0], "icn").atlas = Singleton<PetView>.Instance.EquipAltas; NGUITools.FindInChild<UISprite>(hcList[1], "icn").atlas = Singleton<PetView>.Instance.EquipAltas; NGUITools.FindInChild<UISprite>(hcList[2], "icn").atlas = Singleton<PetView>.Instance.EquipAltas; NGUITools.FindInChild<UISprite>(hcList[0], "icn1").atlas = Singleton<PetView>.Instance.EquipAltas; NGUITools.FindInChild<UISprite>(hcList[1], "icn1").atlas = Singleton<PetView>.Instance.EquipAltas; NGUITools.FindInChild<UISprite>(hcList[2], "icn1").atlas = Singleton<PetView>.Instance.EquipAltas; light = NGUITools.FindChild(rightObj, "hc/light"); NGUITools.FindInChild<Button>(hcList[0], "").onClick = OnCombineEquipClick; NGUITools.FindInChild<Button>(hcList[1], "").onClick = OnCombineEquipClick; NGUITools.FindInChild<Button>(hcList[2], "").onClick = OnCombineEquipClick; NGUITools.FindInChild<UISprite>(rightObj, "hc/current/icn").atlas = Singleton<PetView>.Instance.EquipAltas; NGUITools.FindInChild<UISprite>(rightObj, "fb/current/icn").atlas = Singleton<PetView>.Instance.EquipAltas; rightObj.SetActive(false); }
public void Init(GameObject obj) { gameObject = obj; obj.SetActive(false); name = NGUITools.FindInChild <UILabel>(gameObject, "info/name"); CloseButton = NGUITools.FindInChild <Button>(gameObject, "close"); CloseButton.onClick = OnCloseClick; skill = NGUITools.FindInChild <UIToggle>(gameObject, "info/function/skill"); skill.onStateChange = OnStateChange; property = NGUITools.FindInChild <UIToggle>(gameObject, "info/function/property"); property.onStateChange = OnStateChange; exp = NGUITools.FindInChild <UIToggle>(gameObject, "info/function/exp"); exp.onStateChange = OnStateChange; skillObj = NGUITools.FindChild(gameObject, "skill"); propetyObj = NGUITools.FindChild(gameObject, "property"); expObj = NGUITools.FindChild(gameObject, "exp"); skillPlay = NGUITools.FindInChild <TweenPlay>(skillObj, ""); propertyPlay = NGUITools.FindInChild <TweenPlay>(propetyObj, ""); expPlay = NGUITools.FindInChild <TweenPlay>(expObj, ""); equipObjs = new List <GameObject>(); GameObject equip = NGUITools.FindChild(gameObject, "info/equips/1"); NGUITools.FindInChild <Button>(equip, "").onClick = OnEquipClick; equipObjs.Add(equip); equip = NGUITools.FindChild(gameObject, "info/equips/2"); NGUITools.FindInChild <Button>(equip, "").onClick = OnEquipClick; equipObjs.Add(equip); equip = NGUITools.FindChild(gameObject, "info/equips/3"); NGUITools.FindInChild <Button>(equip, "").onClick = OnEquipClick; equipObjs.Add(equip); equip = NGUITools.FindChild(gameObject, "info/equips/4"); NGUITools.FindInChild <Button>(equip, "").onClick = OnEquipClick; equipObjs.Add(equip); equip = NGUITools.FindChild(gameObject, "info/equips/5"); NGUITools.FindInChild <Button>(equip, "").onClick = OnEquipClick; equipObjs.Add(equip); equip = NGUITools.FindChild(gameObject, "info/equips/6"); NGUITools.FindInChild <Button>(equip, "").onClick = OnEquipClick; equipObjs.Add(equip); GuideEquipButton = NGUITools.FindChild(gameObject, "info/equips/1").GetComponent <Button>(); foreach (GameObject equipObj in equipObjs) { UISprite sprite = NGUITools.FindInChild <UISprite>(equipObj, "bicn"); sprite.atlas = Singleton <PetView> .Instance.EquipAltas; sprite.normalAtlas = Singleton <PetView> .Instance.EquipAltas; sprite.grayAtlas = Singleton <PetView> .Instance.EquipAltas_Gray; NGUITools.FindInChild <UISprite>(equipObj, "icn").atlas = Singleton <PetView> .Instance.EquipAltas; NGUITools.FindChild(equipObj, "icn").SetActive(false); NGUITools.FindInChild <UISprite>(equipObj, "tipicn").atlas = Singleton <PetView> .Instance.EquipAltas; } EventDelegate.Add(NGUITools.FindInChild <TweenPlay>(equipObjs[5], "icn").onFinished, PlayEquipsFinish); stars = new List <UISprite>(); UISprite star1 = NGUITools.FindInChild <UISprite>(gameObject, "info/stars/1"); UISprite star2 = NGUITools.FindInChild <UISprite>(gameObject, "info/stars/2"); UISprite star3 = NGUITools.FindInChild <UISprite>(gameObject, "info/stars/3"); UISprite star4 = NGUITools.FindInChild <UISprite>(gameObject, "info/stars/4"); UISprite star5 = NGUITools.FindInChild <UISprite>(gameObject, "info/stars/5"); stars.Add(star1); stars.Add(star2); stars.Add(star3); stars.Add(star4); stars.Add(star5); currentPPet = null; FightButton = NGUITools.FindInChild <Button>(gameObject, "info/function/fight"); FightButton.onClick = OnFightClick; NGUITools.FindInChild <Button>(gameObject, "info/function/evolve").onClick = OnEvolveClick; NGUITools.FindInChild <Button>(gameObject, "info/function/upgrade").onClick = OnUpgradeClick; skillObjs = new List <GameObject>(); skillObjs.Add(NGUITools.FindChild(gameObject, "skill/1")); skillObjs.Add(NGUITools.FindChild(gameObject, "skill/2")); skillObjs.Add(NGUITools.FindChild(gameObject, "skill/3")); skillObjs.Add(NGUITools.FindChild(gameObject, "skill/4")); GuideSkillButton = NGUITools.FindChild(gameObject, "skill/1/add").GetComponent <Button>(); foreach (GameObject sobj in skillObjs) { NGUITools.FindInChild <UIWidgetContainer>(sobj, "").onPress = OnSkillPress; } skillObjs.Add(NGUITools.FindChild(gameObject, "skill/5")); skillTips = NGUITools.FindChild(Singleton <PetView> .Instance.gameObject, "tips/skilltips"); petTips = NGUITools.FindChild(Singleton <PetView> .Instance.gameObject, "tips/labeltips"); equipTip = NGUITools.FindChild(gameObject, "info/equips/tips"); equipTipPlay = equipTip.GetComponent <TweenPlay>(); light = NGUITools.FindChild(gameObject, "info/light"); light.SetActive(false); NGUITools.FindInChild <Button>(skillObj, "add").onClick = OnAddSkillPointClick; NGUITools.FindInChild <Button>(gameObject, "info/stone/add").onClick = OnAddStoneClick; expObjs = new List <GameObject>(); expObjs.Add(NGUITools.FindChild(expObj, "1")); expObjs.Add(NGUITools.FindChild(expObj, "2")); expObjs.Add(NGUITools.FindChild(expObj, "3")); expObjs.Add(NGUITools.FindChild(expObj, "4")); expObjs[0].GetComponent <Button>().onClick = OnExpItemClick; expObjs[1].GetComponent <Button>().onClick = OnExpItemClick; expObjs[2].GetComponent <Button>().onClick = OnExpItemClick; expObjs[3].GetComponent <Button>().onClick = OnExpItemClick; NGUITools.FindInChild <UISprite>(expObjs[0], "icn").atlas = Singleton <PetView> .Instance.PropAltas; NGUITools.FindInChild <UISprite>(expObjs[1], "icn").atlas = Singleton <PetView> .Instance.PropAltas; NGUITools.FindInChild <UISprite>(expObjs[2], "icn").atlas = Singleton <PetView> .Instance.PropAltas; NGUITools.FindInChild <UISprite>(expObjs[3], "icn").atlas = Singleton <PetView> .Instance.PropAltas; chose = NGUITools.FindChild(expObj, "chose"); NGUITools.FindInChild <Button>(expObj, "use").onClick = OnUseClick; NGUITools.FindInChild <Button>(expObj, "useten").onClick = OnUseTenClick; NGUITools.FindInChild <UIWidgetContainer>(gameObject, "info/tupian").onDrag = OnPetDrag; SetExpItemInfo(); }