public StageBalanceItemUI(GameObject obj) { mObj = obj; mBtn = mObj.GetComponent <UIButton>(); mAwardObject = ObjectCommon.GetChild(mObj, "mAwardObject"); mAwardTweener = ObjectCommon.GetChildComponent <TweenRotation>(mObj, "mAwardObject"); mAwardPanel = ObjectCommon.GetChild(mObj, "mAwardObject/mAwardPanel"); mAwardIcon = ObjectCommon.GetChildComponent <UISprite>(mObj, "mAwardObject/mAwardIcon"); mAwardText = ObjectCommon.GetChildComponent <UILabel>(mObj, "mAwardObject/mAwardText"); mMaskObject = ObjectCommon.GetChild(mObj, "mMaskObject"); mMaskTweener = ObjectCommon.GetChildComponent <TweenRotation>(mObj, "mMaskObject"); mAwardMask = ObjectCommon.GetChild(mObj, "mMaskObject/mAwardMask"); mCostPanel = ObjectCommon.GetChild(mObj, "mMaskObject/mAwardCostPanel"); mCostIcon = ObjectCommon.GetChildComponent <UISprite>(mObj, "mMaskObject/mAwardCostPanel/mAwardCostIcon"); mCostText = ObjectCommon.GetChildComponent <UILabel>(mObj, "mMaskObject/mAwardCostPanel/mAwardCostText"); mAni = ObjectCommon.GetChildComponent <UISpriteAnimation>(mObj, "mAni"); mMaskParamList[0] = new Vector3(0.0f, 63.3f, 0.0f); mMaskParamList[1] = new Vector3(0.0f, 80.5f, 0.0f); mMaskParamList[2] = new Vector3(0.0f, -80.5f, 0.0f); mMaskParamList[3] = new Vector3(0.0f, -63.3f, 0.0f); mAwardParamList[0] = new Vector3(0.0f, -116.7f, 0.0f); mAwardParamList[1] = new Vector3(0.0f, -99.5f, 0.0f); mAwardParamList[2] = new Vector3(0.0f, 99.5f, 0.0f); mAwardParamList[3] = new Vector3(0.0f, 116.7f, 0.0f); Reset(); }
public GameObject FindChild(string path) { if (mView == null) { return(null); } return(ObjectCommon.GetChild(mView, path)); }
public StageBalanceEffectUI(GameObject obj) { mObj = obj; mEffect0 = ObjectCommon.GetChild(mObj, "Effect0"); mEffect1 = ObjectCommon.GetChild(mObj, "Effect1"); mEffect2 = ObjectCommon.GetChild(mObj, "Effect2"); mEffect3 = ObjectCommon.GetChild(mObj, "Effect3"); }
public AwardWidgetUI(GameObject obj) { mObj = obj; backGround2 = ObjectCommon.GetChild(mObj, "background2"); mTween = ObjectCommon.GetChildComponent <UIPlayTween>(mObj, "Award"); DropGrid = ObjectCommon.GetChildComponent <UIGrid>(mObj, "Award/DropGrid"); UIEventListener.Get(backGround2).onClick = CloseUI; }
public FightGradeUI(GameObject go) { valLb = ObjectCommon.GetChildComponent <UILabel>(go, "valObj/valLb"); ani = ObjectCommon.GetChild(go, "ani"); //valLb.transform.parent.transform.localPosition = new Vector3(0f, Screen.height * 0.6f, 0f); mGo = go; }
public ChaRankAwardUI(GameObject obj) { mGameObject = obj; mRankLabel = ObjectCommon.GetChildComponent <UILabel>(mGameObject, "RankLabel"); mRankIcon = ObjectCommon.GetChildComponent <UISprite>(mGameObject, "RankIcon"); mTip1 = ObjectCommon.GetChildComponent <UILabel>(mGameObject, "Tip1"); mTip2 = ObjectCommon.GetChildComponent <UILabel>(mGameObject, "TipTxt2"); mAwardGuid = ObjectCommon.GetChildComponent <UIGrid>(mGameObject, "AwardGrid"); Background = ObjectCommon.GetChild(mGameObject, "BackGround"); }
public PlayerHeadUI(GameObject go) { mObj = go; if (go == null) { return; } nameLb = ObjectCommon.GetChild(go, "name").GetComponent <UILabel>(); titleSp = ObjectCommon.GetChildComponent <UISprite>(go, "titleSp"); }
public void addItem(int index) { GameObject prefabObject = ObjectCommon.GetChild(gameObject, "item"); GameObject childObject = GameObject.Instantiate(prefabObject); childObject.name = "item" + index; childObject.transform.SetParent(gameObject.transform); childObject.transform.localPosition = Vector2.zero; childObject.transform.localScale = Vector2.one; childObject.SetActive(true); }
IEnumerator LoadPrefabFromRes(string name, params object[] paramsList) { ResourceRequest quest = Resources.LoadAsync("Prefabs/Gui/" + name); yield return(quest); GameObject instance = Instantiate(quest.asset) as GameObject; Transform instanceTran = instance.transform; instanceTran.parent = GameUiManager.UIRootTran; instanceTran.localPosition = Vector3.zero; instanceTran.localScale = Vector3.one; GameObject mainBottomObj = ObjectCommon.GetChild(GameUiManager.UIRootTran.gameObject, PanelType.UIMain_bottom); if (mainBottomObj != null) { mainBottomObj.transform.SetSiblingIndex(instanceTran.GetSiblingIndex()); } PanelManager.PanelModuleData panelData = PanelManager.GetInstance().getComponent(name); Debuger.LogError("pannel data is null ?" + panelData); instance.name = name; string component = panelData.panelName; if (string.IsNullOrEmpty(component) == false) { instance.AddComponent(panelData.panelType); } UIPanelBase panel = instance.gameObject.GetComponent <UIPanelBase>(); if (instance != null && instance.gameObject != null) { instance.gameObject.SetActive(true); } if (panel != null) { panel.OnShow(); //GameUiManager.getInst().DontUseThisShowPanel(panel, paramsList); } GameUiManager.getInst().addLoadedWindow(name, panel, true); GameUiManager.getInst().removeLoadingWindow(name); }
void setRedPointActive(GameObject parent, bool active) { if (parent == null) { return; } GameObject go = ObjectCommon.GetChild(parent, "hongdian"); if (go != null) { go.SetActive(active); } }
public SkillItemUI(GameObject view) { mView = view; skillIcon = ObjectCommon.GetChildComponent <UISprite>(view, "skillIcon"); selectSp = ObjectCommon.GetChildComponent <UISprite>(view, "selectSp"); lockSp = ObjectCommon.GetChildComponent <UISprite>(view, "lockSp"); unLockSp = ObjectCommon.GetChildComponent <UISprite>(view, "unlockSp"); mLevel = ObjectCommon.GetChildComponent <UILabel>(view, "level"); hintLb = ObjectCommon.GetChildComponent <UILabel>(view, "hintLb"); equipObj = ObjectCommon.GetChild(view, "SkillNum"); equipSlotNum = ObjectCommon.GetChildComponent <UILabel>(view, "SkillNum/numLb"); }
public override void Init() { //初始化属性 m_props = new GameGunProps(); m_props.m_bulletLauncherData = BulletLauncherDataBase.CreateBulletLauncherData(EBulletLauncherType.SingleBullet); m_bulletLauncher = BulletLauncherBase.CreateBulletLauncherBase(m_props.m_bulletLauncherData, gameObject, m_tempBullet); m_gunNode = ObjectCommon.GetChild(gameObject, "gun_sprite"); m_recordSpritePosition = m_gunNode.transform.localPosition; m_bulletNode = ObjectCommon.GetChild(gameObject, "bullet_node"); }
public UIWantedItem(GameObject obj) { mObj = obj; mHover = ObjectCommon.GetChild(obj, "mHover"); mMask = ObjectCommon.GetChildComponent <UISprite>(obj, "mMask"); mNameText = ObjectCommon.GetChildComponent <UILabel>(obj, "mNameText"); mTimesText = ObjectCommon.GetChildComponent <UILabel>(obj, "mTimesText"); mBossIcon = ObjectCommon.GetChildComponent <UISprite>(obj, "mBossIcon"); mLockPic = ObjectCommon.GetChild(obj, "mLockPic"); mGradeList[0] = ObjectCommon.GetChild(obj, "mGradeC"); mGradeList[1] = ObjectCommon.GetChild(obj, "mGradeB"); mGradeList[2] = ObjectCommon.GetChild(obj, "mGradeA"); mGradeList[3] = ObjectCommon.GetChild(obj, "mGradeS"); }
public CropsItemGridUI(GameObject obj) { mObj = obj; mIcon = ObjectCommon.GetChildComponent <UISprite>(mObj, "pic"); mSelected = ObjectCommon.GetChildComponent <UISprite>(mObj, "selected"); for (int i = 0; i < 5; ++i) { mStarsList.Add(ObjectCommon.GetChildComponent <UISprite>(mObj, "stars" + (i + 1))); } mCropsname = ObjectCommon.GetChildComponent <UILabel>(mObj, "cropsname"); mState = ObjectCommon.GetChild(mObj, "state"); mOnclick = ObjectCommon.GetChildComponent <UISprite>(mObj, "cropslock"); UIEventListener.Get(mObj).onClick = OnClick; }
private void Awake() { GameObject bottomLeftObj = ObjectCommon.GetChild(gameObject, "bottom/left"); labelLevel = ObjectCommon.GetChildComponent <Text>(bottomLeftObj, "level_value"); labelAttack = ObjectCommon.GetChildComponent <Text>(bottomLeftObj, "attack_value"); labelHp = ObjectCommon.GetChildComponent <Text>(bottomLeftObj, "hp_value"); labelPhysicDefence = ObjectCommon.GetChildComponent <Text>(bottomLeftObj, "phy_defence_value"); labelMagicDefence = ObjectCommon.GetChildComponent <Text>(bottomLeftObj, "mag_defence (1)"); GameObject topObj = ObjectCommon.GetChild(gameObject, "equip_list"); eventTrigger = ObjectCommon.GetChildComponent <EventTrigger>(topObj, "equip_head"); btn = ObjectCommon.GetChildComponent <Button>(topObj, "equip_head"); btn.onClick.AddListener(OnEquipHeadClicked); ClientEventManager.GetInstance().AddProcessFunction(GameEventID.GEDynamicHudPos_Add, OnEquipWeared); }
public StageListItemUI(GameObject obj) { mObj = obj; mBackground = ObjectCommon.GetChild(obj, "mBackground"); mHover = ObjectCommon.GetChild(obj, "mHover"); mStagePic = ObjectCommon.GetChildComponent <UISprite>(obj, "mStagePic"); mLockPic = ObjectCommon.GetChild(obj, "mLockPic"); mBossIcon = ObjectCommon.GetChildComponent <UISprite>(obj, "mBossIcon"); mStarSlot0 = ObjectCommon.GetChild(obj, "mStarSlot0"); mStarSlot1 = ObjectCommon.GetChild(obj, "mStarSlot1"); mStarSlot2 = ObjectCommon.GetChild(obj, "mStarSlot2"); mStarIcon0 = ObjectCommon.GetChild(obj, "mStarIcon0"); mStarIcon1 = ObjectCommon.GetChild(obj, "mStarIcon1"); mStarIcon2 = ObjectCommon.GetChild(obj, "mStarIcon2"); mStageNameText = ObjectCommon.GetChildComponent <UILabel>(obj, "mStageNameText"); mLevelText = ObjectCommon.GetChildComponent <UILabel>(obj, "mLevelText"); mEnterTimeText = ObjectCommon.GetChildComponent <UILabel>(obj, "mEnterTimesText"); mMask = ObjectCommon.GetChildComponent <UISprite>(obj, "mMask"); }
public CropsShopGridUI(GameObject obj) { mObj = obj; mIcon = ObjectCommon.GetChildComponent <UISprite>(mObj, "cropspic"); mSelected = ObjectCommon.GetChildComponent <UISprite>(mObj, "selected"); mCropsjob = ObjectCommon.GetChildComponent <UISprite>(mObj, "cropsjob"); for (int i = 0; i < 5; ++i) { mStarsList.Add(ObjectCommon.GetChildComponent <UISprite>(mObj, "stars" + (i + 1))); } mOnclick = ObjectCommon.GetChildComponent <UISprite>(mObj, "onclick"); mCropsname = ObjectCommon.GetChildComponent <UILabel>(mObj, "cropsname"); mState = ObjectCommon.GetChild(mObj, "state"); mLock = ObjectCommon.GetChild(mObj, "lockinfo"); mCurHasNum = ObjectCommon.GetChildComponent <UILabel>(mObj, "lockinfo/Label"); mCurNumSp = ObjectCommon.GetChildComponent <UISlider>(mObj, "lockinfo/itembg1"); UIEventListener.Get(mObj).onClick = OnClick; }
public GuideTalkUI(GameObject obj) { mObject = obj; mMaskBar = ObjectCommon.GetChild(mObject, "mMaskBar"); mMaskBtn = ObjectCommon.GetChild(mObject, "mMaskBtn"); mSkipBtn = ObjectCommon.GetChild(mObject, "mMaskBar/mSkipBtn"); mTopDlg = new GuideTalkDialogUI(); mTopDlg.mWidget = ObjectCommon.GetChildComponent <UIWidget>(mObject, "mTopWidget"); mTopDlg.mHead = ObjectCommon.GetChildComponent <UISprite>(mObject, "mTopWidget/mTopHead"); mTopDlg.mHeadAnchor = ObjectCommon.GetChildComponent <UIAnchor>(mObject, "mTopWidget/mTopHead"); mTopDlg.mAnchor = ObjectCommon.GetChildComponent <UIAnchor>(mObject, "mTopWidget/mTopTextPanel"); mTopDlg.mTitle = ObjectCommon.GetChildComponent <UILabel>(mObject, "mTopWidget/mTopTextPanel/mTopTitleText"); mTopDlg.mTitleEffect = ObjectCommon.GetChild(mObject, "mTopWidget/mTopTextPanel/mTopTitleText"); mTopDlg.mContent = ObjectCommon.GetChildComponent <UILabel>(mObject, "mTopWidget/mTopTextPanel/mTopContentText"); mTopDlg.mContentEffect = ObjectCommon.GetChild(mObject, "mTopWidget/mTopTextPanel/mTopContentText"); mTopDlg.mBtn = ObjectCommon.GetChildComponent <UISprite>(mObject, "mTopWidget/mTopTextPanel/mTopPressBtn"); mBottomDlg = new GuideTalkDialogUI(); mBottomDlg.mWidget = ObjectCommon.GetChildComponent <UIWidget>(mObject, "mBottomWidget"); mBottomDlg.mHead = ObjectCommon.GetChildComponent <UISprite>(mObject, "mBottomWidget/mBottomHead"); mBottomDlg.mHeadAnchor = ObjectCommon.GetChildComponent <UIAnchor>(mObject, "mBottomWidget/mBottomHead"); mBottomDlg.mAnchor = ObjectCommon.GetChildComponent <UIAnchor>(mObject, "mBottomWidget/mBottomTextPanel"); mBottomDlg.mTitle = ObjectCommon.GetChildComponent <UILabel>(mObject, "mBottomWidget/mBottomTextPanel/mBottomTitleText"); mBottomDlg.mTitleEffect = ObjectCommon.GetChild(mObject, "mBottomWidget/mBottomTextPanel/mBottomTitleText"); mBottomDlg.mContent = ObjectCommon.GetChildComponent <UILabel>(mObject, "mBottomWidget/mBottomTextPanel/mBottomContentText"); mBottomDlg.mContentEffect = ObjectCommon.GetChild(mObject, "mBottomWidget/mBottomTextPanel/mBottomContentText"); mBottomDlg.mBtn = ObjectCommon.GetChildComponent <UISprite>(mObject, "mBottomWidget/mBottomTextPanel/mBottomPressBtn"); mSkipBtn.SetActive(false); mMaskBar.SetActive(false); mMaskBtn.SetActive(false); }
protected override void OnLoad() { base.OnLoad(); midBk = FindChild("Content/Background/MidBK"); //翻页 pagePrev = FindComponent <UIButton>("Content/Background/MidBK/WingList/pagePre"); pagePrevAni = FindComponent <UIButton>("Content/Background/MidBK/WingList/pagePreAni"); pageNext = FindComponent <UIButton>("Content/Background/MidBK/WingList/pageNext"); pageNextAni = FindComponent <UIButton>("Content/Background/MidBK/WingList/pageNextAni"); //翅膀 wingItemProfab = FindChild("wingItem"); mWingItemUIList = new List <WingItemUI>(); winggrid = FindChild("Content/Background/MidBK/WingList/winggrid"); wingName = FindComponent <UILabel>("Content/Background/MidBK/WingList/wingName"); buffDesc = FindComponent <UILabel>("Content/Background/MidBK/WingList/bufftext"); //翅膀试穿 mPreviewSprite = FindComponent <UISprite>("Content/Background/MidBK/WingList/mPreView"); mPreviewSprite.transform.localPosition = Vector3.zero; mCharacterPreview = new UICharacterPreview(); wingItemProfab.SetActive(false); tip = FindComponent <UILabel>("Content/Background/MidBK/WingList/tip"); tip.gameObject.SetActive(true); tip.pivot = UIWidget.Pivot.Left; tip.gameObject.transform.localPosition = new Vector3(-304f, -145f, 0); pageSprite = FindChild("pageItem"); pageBar = new LockStatePageBarUI(FindChild("Content/Background/MidBK/lockStateBar"), WingDefine.MaxWingNum, pageSprite); WingDescript = FindChild("Content/Background/WingDescript"); WingDescriptText = FindComponent <UILabel>("Content/Background/WingDescript/WingDescriptText"); //翅膀进度条 levelbar = FindChild("Content/Background/levelbar"); levelnum = FindComponent <UILabel>("Content/Background/levelbar/levelnum"); nextLevel = FindComponent <UILabel>("Content/Background/levelbar/nextLevel"); levelPercent = FindComponent <UILabel>("Content/Background/levelbar/levelPercent"); levelProcessbar = FindComponent <UISlider>("Content/Background/levelbar/levelProcessbar"); levbarAni = FindComponent <UISprite>("Content/Background/levelbar/levbarAni"); levbarAni.gameObject.SetActive(false); UISpriteAnimation ani = levbarAni.gameObject.GetComponent <UISpriteAnimation>(); ani.Reset(); ani.onFinished += AnimationFinesh; //翅膀属性 wingPropObj = FindChild("Content/Background/wingPrperty"); mProps = new List <WingPropertyItem>(); for (int i = 0; i < WingDefine.PropertyNum; ++i) { var tempP = new WingPropertyItem(ObjectCommon.GetChild(wingPropObj, "Grid/prop" + (i + 1))) { mType = (WingPropertyType)i }; mProps.Add(tempP); } //消耗物品 stuff = FindComponent <UISprite>("Content/Background/wingPrperty/stuff"); stuffname = FindComponent <UILabel>("Content/Background/wingPrperty/stuff/stuffname"); stuffnum = FindComponent <UILabel>("Content/Background/wingPrperty/stuff/stuffnum"); jihuotiaojianTxt = FindComponent <UILabel>("Content/Background/jihuotiaojian/jihuotiaojianTxt"); backBtn = FindComponent <UIButton>("Content/Background/MidBK/WingList/backBtn"); tryOnBtn = FindComponent <UIButton>("Content/Background/MidBK/WingList/wearBtn"); jihuoAni = FindComponent <UISprite>("Content/Background/UnlockCondition/jihuoAni"); jihuoAni.gameObject.SetActive(false); jihuoBtn = FindComponent <UIButton>("Content/Background/UnlockCondition/jihuoBtn"); zhanValue = FindComponent <UILabel>("Content/Background/jihuotiaojian/zhanBK/zhanValue"); jinglianBtn = FindComponent <UIButton>("Content/Background/wingPrperty/jinglianBtn"); jinglianTxt = FindComponent <UILabel>("Content/Background/wingPrperty/jinglianBtn/Label"); equipBtn = FindComponent <UIButton>("Content/Background/wingPrperty/equipBtn"); equipWord = FindComponent <UILabel>("Content/Background/wingPrperty/equipBtn/Label"); UnlockCondition = FindChild("Content/Background/UnlockCondition"); mConditionUIList = new List <wingConditionUI>(); for (int i = 0; i < WingDefine.MaxConditonNum; ++i) { mConditionUIList.Add(new wingConditionUI(ObjectCommon.GetChild(UnlockCondition, "Grid/dachengdiaojian" + (i + 1)))); } if (mNeedInit) { Init(); } }