public UIArenaRole(GameObject obj) { mObj = obj; mInfoText = ObjectCommon.GetChildComponent <UILabel>(obj, "mRoleTopPanel/mInfoText"); mBattleGradeText = ObjectCommon.GetChildComponent <UILabel>(obj, "mRoleTopPanel/mBattleGradeText"); mAwardText = ObjectCommon.GetChildComponent <UILabel>(obj, "mRoleBottomPanel/mAwardText"); mRoleModel = ObjectCommon.GetChildComponent <UISprite>(obj, "mModelPanel"); mBeginBtn = ObjectCommon.GetChildComponent <UIButton>(obj, "mBeginBtn"); mPreview.SetTargetSprite(mRoleModel); mPreview.RotationY = 180; }
protected override void OnOpen(object param = null) { base.OnOpen(param); AddEventListener(); AddEventDelegate(); mWingItemUIList[CurPageNum - 1].IsTryOn = false; mWingItemUIList[CurPageNum - 1].mView.SetActive(true); mPreviewSprite.gameObject.SetActive(false); mCharacterPreview.RotationY = 180; upDownAniHandler(); if (mCharacterPreview != null) { mCharacterPreview.Enable = false; } if (mWingItemUIList.Count < mWingMoudle.GetWingPageCount()) { for (int i = mWingItemUIList.Count + 1; i <= mWingMoudle.GetWingPageCount(); ++i) { CreateWingItem(i); } winggrid.GetComponent <UIGrid>().repositionNow = true; } else if (mWingItemUIList.Count > mWingMoudle.GetWingPageCount()) { foreach (var wingItemUi in mWingItemUIList) { wingItemUi.Clear(); } mWingItemUIList.Clear(); Init(); } mCharacterPreview.BackgroundSprite = mPreviewSprite; mCharacterPreview.SetTargetSprite(mPreviewSprite); mCharacterPreview.SetCameraOrthographicSize(1.5f); mCharacterPreview.RotationY = 180; upDownAniHandler(); mIsDirty = true; }
private void InitUI() { EventSystem.Instance.addEventListener(CropsEvent.TAB_INDEX, SetTabIndex); EventSystem.Instance.addEventListener(CropsEvent.BUY_CROPS, OnCropsBuyHandler); EventSystem.Instance.addEventListener(CropsEvent.CHANGE_CROPS, OnChangeHandler); EventSystem.Instance.addEventListener(CropsEvent.RISE_STARS, OnRiseStarsHandler); EventDelegate.Add(mBtnCampBuy.onClick, OnBtnBuyCropsHandler); EventDelegate.Add(mBtnMainCrops.onClick, OnBtnSetMainCropsHandler); EventDelegate.Add(mBtnSubCrops.onClick, OnBtnSetSubCropsHandler); EventDelegate.Add(mBtnRiseStars.onClick, OnBtnRiseStarsHandler); UIEventListener.Get(mBtnSkill1.gameObject).onPress = OnBtnSkill1Press; UIEventListener.Get(mBtnSkill2.gameObject).onPress = OnBtnSkill2Press; UIEventListener.Get(mBtnSkill3.gameObject).onPress = OnBtnSkill3Press; InitCampUI(); InitRiseStarsUI(); mPreview.SetTargetSprite(mPreveiwSprite); mPreview.SetCameraOrthographicSize(1.5f); mPreview.RotationY = 180; }
protected override void OnOpen(object param = null) { base.OnOpen(param); mModule = ModuleManager.Instance.FindModule <FashionModule>(); IDictionaryEnumerator enumerator = mItemDic.GetEnumerator(); while (enumerator.MoveNext()) { FashionItemUI item = enumerator.Value as FashionItemUI; item.clickCallBack = ItemClickCallBack; } EventDelegate.Add(mAddStarBtn.onClick, OnAddStartClick); EventDelegate.Add(mWearBtn.onClick, OnEquipClick); EventDelegate.Add(mBuyBtn.onClick, OnBuyBtnClick); EventSystem.Instance.addEventListener(FashionEvent.FASHION_ACTIVE, OnRespondActive); EventSystem.Instance.addEventListener(FashionEvent.FASHION_EQUIP, OnRespondEquip); mSelectedId = SelectedId; RefreshListPanel(); if (mCharacterPreview != null) { mCharacterPreview.Enable = true; } Player player = PlayerController.Instance.GetControlObj() as Player; if (player != null) { mCharacterPreview.BackgroundSprite = mPreview; mCharacterPreview.SetTargetSprite(mPreview); mCharacterPreview.SetCameraOrthographicSize(1.2f); mCharacterPreview.RotationY = 180; mCharacterPreview.Pos = new Vector3(-0.25f, 0, 0); mCharacterPreview.SetupCharacter(player.ModelID, null, -1, 0); PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>(); mCharacterPreview.ChangeWeapon(pdm.GetMainWeaponId()); } }
protected override void OnLoad() { base.OnLoad(); mButtonReadMe = FindComponent <UIButton>("mainContainer/Center/ReadMe"); mButtonLeftBtn = FindComponent <UIButton>("mainContainer/Center/PageLeft"); mButtonRightBtn = FindComponent <UIButton>("mainContainer/Center/PageRight"); mLabelMyFight = FindComponent <UILabel>("mainContainer/Bottom/MyFigh"); mLabelMyFightTxt = FindComponent <UILabel>("mainContainer/Bottom/MyFightTxt"); mLabelRecomFight = FindComponent <UILabel>("mainContainer/Bottom/RecomFight"); mLabelScrib = FindComponent <UILabel>("mainContainer/Bottom/Scrib"); mLabelState = FindComponent <UILabel>("mainContainer/Bottom/State/Label"); mButtonOk = FindComponent <UIButton>("mainContainer/Bottom/BtnGrid/OkBtn"); mButtonSweep = FindComponent <UIButton>("mainContainer/Bottom/BtnGrid/Sweep"); mButtonBack = FindComponent <UIButton>("mainContainer/Bottom/BtnGrid/Back"); mButtonDoAgain = FindComponent <UIButton>("mainContainer/Bottom/BtnGrid/DoAgain"); mButtonRank = FindComponent <UIButton>("mainContainer/Bottom/Paihang"); mScrolV = FindComponent <UIScrollView>("mainContainer/Center/Scroll View"); mGridDrop = FindComponent <UIGrid>("mainContainer/Bottom/DropGrid"); mBtnGrid = FindComponent <UIGrid>("mainContainer/Bottom/BtnGrid"); mGridFloor = FindComponent <UIGrid>("mainContainer/Center/Scroll View/Grid"); mSpriteAchieveOne = FindComponent <UISprite>("mainContainer/Bottom/AchieveGrid/Achieve1"); mSpriteAchieveTwo = FindComponent <UISprite>("mainContainer/Bottom/AchieveGrid/Achieve2"); mSpriteAchieveThree = FindComponent <UISprite>("mainContainer/Bottom/AchieveGrid/Achieve3"); mLabelWeekScore = FindComponent <UILabel>("mainContainer/Bottom/WeekScoreNum"); mFirstDrop = FindChild("mainContainer/Bottom/DropGrid/FirstDrop"); mNormalDrop = FindChild("mainContainer/Bottom/DropGrid/SecondDrop"); mBackGround = FindChild("BackGround"); mExamRankItem = FindChild("ViewItem"); mExamRankItem.SetActive(false); mRankTween = FindComponent <UIPlayTween>("rankContainer"); mMainTween = FindComponent <UIPlayTween>("mainContainer"); mRankLeftTween = FindComponent <TweenPosition>("rankContainer/left"); mRankRightTween = FindComponent <TweenPosition>("rankContainer/right"); mMainTweenPos = FindComponent <TweenPosition>("mainContainer"); mMainTween.resetOnPlay = true; mRankTween.resetOnPlay = true; mRankNum = FindComponent <UILabel>("rankContainer/right/ranknum"); mPlayerName = FindComponent <UILabel>("rankContainer/right/playername"); mRankTimer = FindComponent <UILabel>("rankContainer/right/awardIcon/timer"); mShowAwardBtn = FindComponent <UIButton>("rankContainer/right/awardIcon"); mGoToChalBtn = FindComponent <UIButton>("rankContainer/right/GotoChallenge"); mSelfScore = FindComponent <UILabel>("rankContainer/right/scorebg/Label"); mScoreTip = FindComponent <UILabel>("rankContainer/right/tip"); mPreview = FindComponent <UISprite>("rankContainer/right/Preview"); mDizuo = FindComponent <UISprite>("rankContainer/right/dizuo"); mRankGuid = FindComponent <UIGrid>("rankContainer/left/scrollView/itemguid"); mRanAwardPanel = new ChaRankAwardUI(FindChild("RankAwardPanel")); mRanAwardPanel.mGameObject.SetActive(false); mExamChallengeBtn = FindChild("floorinfo"); mExamChallengeBtn.gameObject.SetActive(false); mChalModule = ModuleManager.Instance.FindModule <ChallengeModule>(); mCharacterPreview = new UICharacterPreview(); mCharacterPreview.BackgroundSprite = mDizuo; mCharacterPreview.SetTargetSprite(mPreview); mCharacterPreview.SetCameraOrthographicSize(1.2f); mCharacterPreview.RotationY = 180; mCharacterPreview.Pos = new Vector3(0, 0.3f, 0); mCharacterPreview.Enable = true; //初始化 InitUI(); }
protected override void OnLoad() { base.OnLoad(); for (int i = 0; i < (int)EquipSlot.EquipSlot_MAX; ++i) { mEquipUI[i] = new CommonItemUI(this.FindChild("RolePanel/Equip" + (i + 1).ToString())); } for (int i = 0; i < msMaxWingNum; ++i) { mWingObject[i] = this.FindChild("ProperyPanel/AllDisScroll/Panel/Wings/WingScroll/Wing" + (i + 1).ToString()); mWingIcon[i] = this.FindComponent <UISprite>("ProperyPanel/AllDisScroll/Panel/Wings/WingScroll/Wing" + (i + 1).ToString() + "/icon"); mWingLevel[i] = this.FindComponent <UILabel>("ProperyPanel/AllDisScroll/Panel/Wings/WingScroll/Wing" + (i + 1).ToString() + "/level"); } mRoleName = this.FindComponent <UILabel>("RolePanel/Name"); mName = this.FindComponent <UILabel>("ProperyPanel/AllDisScroll/Panel/Name"); mZhanli1 = this.FindComponent <UILabel>("ProperyPanel/AllDisScroll/Panel/Zhanli"); mZhanli2 = this.FindComponent <UILabel>("RolePanel/Zhanli/Label"); mExp = this.FindComponent <UILabel>("ProperyPanel/AllDisScroll/Panel/Exp"); mHp = this.FindComponent <UILabel>("ProperyPanel/AllDisScroll/Panel/hp"); mMp = this.FindComponent <UILabel>("ProperyPanel/AllDisScroll/Panel/mp"); mDefence = this.FindComponent <UILabel>("ProperyPanel/AllDisScroll/Panel/fanghu"); mDamage = this.FindComponent <UILabel>("ProperyPanel/AllDisScroll/Panel/shanghai"); mCritLv = this.FindComponent <UILabel>("ProperyPanel/AllDisScroll/Panel/baoji"); mMainCrops = this.FindChild("ProperyPanel/AllDisScroll/Panel/Crops/CropsItem1"); mSubCrops = this.FindChild("ProperyPanel/AllDisScroll/Panel/Crops/CropsItem2"); mWeaponIcon = this.FindComponent <UIButton>("RolePanel/bg/weapon"); mPreveiwSprite = this.FindComponent <UISprite>("RolePanel/RoleModel"); mTitleBtn = this.FindComponent <UIButton>("RolePanel/bntChenghao"); mBtnWeapon = this.FindComponent <UIButton>("RolePanel/bg/weapon"); mOpenBtn = this.FindComponent <UIButton>("RolePanel/bntBag"); mInfoPanel = this.FindChild("ProperyPanel"); mWeaponSterLv = this.FindComponent <UILabel>("RolePanel/weaponlv"); mWeaponPromoteLv = this.FindComponent <UILabel>("RolePanel/jieji/Label"); mWeaponGradeBg = this.FindComponent <UISprite>("RolePanel/zhishi"); mWeaponGradePic = this.FindComponent <UISprite>("RolePanel/zhishi/lv"); mWeaponLvPic = this.FindComponent <UISprite>("RolePanel/xingji"); // mOpenLabel = this.FindComponent <UILabel>("RolePanel/bntBag/Label"); mTitleBtn.gameObject.SetActive(false); mOpenLabel.text = "打开背包"; mInfoPanel.SetActive(true); mOpenBtn.gameObject.SetActive(false); // // mItemsGrid = this.FindComponent<UIGrid>("ItemPanel/ItemsScrollView/UIGrid"); // // EventDelegate.Add(mToggleAll.onChange, onToggleChanged); // EventDelegate.Add(mToggleItem.onChange, onToggleChanged); // EventDelegate.Add(mToggleGem.onChange, onToggleChanged); // EventDelegate.Add(mOpenBtn.onClick, onOpenButtonClick); EventDelegate.Add(mBtnWeapon.onClick, OnBtnWeaponClick); mPreveiwSprite.width = mPreveiwSprite.height; mPreview.SetTargetSprite(mPreveiwSprite); mPreview.RotationY = 180; }