public void SetDaChengPicVisable(int condition) { for (int i = 0; i < WingDefine.MaxConditonNum; i++) { if ((condition & (1 << i)) == 0) //没有达成条件i+1 { if (mDaChengPicList[i].atlas.name == "chibangjiesuoblue") { mDaChengPicList[i].transform.localEulerAngles = new Vector3(0, 0, 143); mDaChengPicList[i].transform.localPosition = new Vector3(2.73f, 1.22f, 0); } UIAtlasHelper.SetSpriteImage(mDaChengPicList[i], "chibangjiesuored:jm_chibangjiesuo1_00000"); UISpriteAnimation sa = mDaChengPicList[i].GetComponent <UISpriteAnimation>(); sa.RebuildSpriteList(); sa.Reset(); } else { if (mDaChengPicList[i].atlas.name == "chibangjiesuored") { mDaChengPicList[i].transform.localEulerAngles = Vector3.zero; mDaChengPicList[i].transform.localPosition = Vector3.zero; } UIAtlasHelper.SetSpriteImage(mDaChengPicList[i], "chibangjiesuoblue:jm_chibangjiesuo2_00000"); UISpriteAnimation sa = mDaChengPicList[i].GetComponent <UISpriteAnimation>(); sa.RebuildSpriteList(); sa.Reset(); } } }
private void Init() { mModule.State = StageEndModule.UIState.STATE_ORIGINAL; mLevelUp.SetActive(false); mGradeS.gameObject.SetActive(false); mGradeS.ResetToBeginning(); mGradeA.gameObject.SetActive(false); mGradeA.ResetToBeginning(); mGradeB.gameObject.SetActive(false); mGradeB.ResetToBeginning(); mGradeC.gameObject.SetActive(false); mGradeC.ResetToBeginning(); mTitle0.alpha = 0.0f; mTitle1.alpha = 0.0f; mBottomPanel.alpha = 0.0f; mBallBk.alpha = 0.0f; mInfoPanel0.alpha = 0.0f; mInfoPanel1.alpha = 0.0f; mInfoPanel2.alpha = 0.0f; mTopPanel.alpha = 0.0f; mBackground.alpha = 0.6f; mInfoPanel.gameObject.transform.localPosition = new Vector3(mInfoPanel.gameObject.transform.localPosition.x, mInfoPosY, mInfoPanel.gameObject.transform.localPosition.z); mBallBk.gameObject.transform.localPosition = new Vector3(mBallBk.gameObject.transform.localPosition.x, mBallPosY, mBallBk.gameObject.transform.localPosition.z); mBallBk.gameObject.transform.localScale = Vector3.one; mWidget.topAnchor.relative = 2.0f; mWidget.bottomAnchor.relative = 1.0f; mCurExp = mPlayerModule.GetExp(); mAddExp = mModule.GetExp(); mMaxExp = GetMaxExp(); mExpSpeed = (int)(mAddExp / StageEndModule.STATETIME_9); UpdateExp(); mGradeAni.Reset(); mGradeAni.gameObject.SetActive(false); mInfoAni0.Reset(); mInfoAni0.gameObject.SetActive(false); mInfoAni1.Reset(); mInfoAni1.gameObject.SetActive(false); mInfoAni2.Reset(); mInfoAni2.gameObject.SetActive(false); mBorderAni.Reset(); mBorderAni.gameObject.SetActive(false); //mUIPanel.alpha = 0.0f; mTimer = 0.0f; mInfoValue2.text = mModule.GetPassTimeStr(); mInfoRecordValue2.text = mInfoValue2.text; if (mGradeMap == null) { mGradeMap = new Dictionary <StageGrade, UITweener>(); mGradeMap.Add(StageGrade.StageGrade_S, mGradeS); mGradeMap.Add(StageGrade.StageGrade_A, mGradeA); mGradeMap.Add(StageGrade.StageGrade_B, mGradeB); mGradeMap.Add(StageGrade.StageGrade_C, mGradeC); } }
void InitializeAnimation() { KingAnimation.Reset(); QueenAnimation.Reset(); KingAnimation.enabled = false; QueenAnimation.enabled = false; }
private void upDownAniHandler() { if (mWingItemUIList[CurPageNum - 1].IsTryOn) { pageNextAni.gameObject.SetActive(false); pagePrevAni.gameObject.SetActive(false); pageNext.gameObject.SetActive(false); pagePrev.gameObject.SetActive(false); } else { switch (getCurPagePos()) { case Pos.FirstLast: pageNextAni.gameObject.SetActive(false); pagePrevAni.gameObject.SetActive(false); pageNext.gameObject.SetActive(false); pagePrev.gameObject.SetActive(false); break; case Pos.First: pagePrevAni.gameObject.SetActive(false); pagePrev.gameObject.SetActive(true); pageNextAni.gameObject.SetActive(true); pageNext.gameObject.SetActive(false); break; case Pos.Last: pageNextAni.gameObject.SetActive(false); pageNext.gameObject.SetActive(true); pagePrevAni.gameObject.SetActive(true); pagePrev.gameObject.SetActive(false); break; case Pos.Med: pageNextAni.gameObject.SetActive(true); pagePrevAni.gameObject.SetActive(true); pageNext.gameObject.SetActive(false); pagePrev.gameObject.SetActive(false); break; } } UISpriteAnimation ani1 = pageNextAni.GetComponent <UISpriteAnimation>(); if (ani1 != null) { ani1.Reset(); } UISpriteAnimation ani2 = pagePrevAni.GetComponent <UISpriteAnimation>(); if (ani2 != null) { ani2.Reset(); } }
public void PlayTween() { var tween = mAdd.gameObject.GetComponent <UIPlayTween>(); mAdd.text = "+" + mMaxNum; tween.resetOnPlay = true; mAdd.transform.localPosition = new Vector3(0, -54, 0); mAdd.alpha = 1; tween.Play(true); mAni.gameObject.SetActive(true); mAni.Reset(); }
private void PlayAnim(String p_animName) { Collider[] componentsInChildren = m_CloseAnim.GetComponentsInChildren <Collider>(); foreach (Collider collider in componentsInChildren) { collider.enabled = (p_animName == m_CloseAnimName); } if (m_CloseAnim.namePrefix != p_animName) { m_CloseAnim.namePrefix = p_animName; m_CloseAnim.Reset(); } }
void OnEnable() { //string player_sprite_type = PlayerPrefs.GetString("PlayerSprite", "King"); string player_sprite_type = GameDataBase.getDBinstance.getUserDB.PlayerSpriteName; if (player_sprite_type.Equals("King")) { kira_Player_Sprite.transform.localPosition = Vector2.zero; } else if (player_sprite_type.Equals("Queen")) { kira_Player_Sprite.transform.localPosition = new Vector2(34, -5f); } player_animation.namePrefix = "attack_" + player_sprite_type + "_0"; player_animation.Reset(); player_animation.transform.localScale = new Vector3(2.3f, 2.3f, 2.3f); player_animation.enabled = false; kira_Player_Sprite.spriteName = "emotion_" + player_sprite_type + "_kira"; kira_Player_Sprite.MakePixelPerfect(); }
void upDownAniHandler2() { switch (getCurPagePos(PageVal2, mLimitItems)) { case Pos.FirstLast: xPageRightBtnAni.gameObject.SetActive(false); xPageLeftBtnAni.gameObject.SetActive(false); xPageRightBtn.gameObject.SetActive(true); xPageLeftBtn.gameObject.SetActive(true); break; case Pos.First: xPageLeftBtnAni.gameObject.SetActive(false); xPageLeftBtn.gameObject.SetActive(true); xPageRightBtnAni.gameObject.SetActive(true); xPageRightBtn.gameObject.SetActive(false); break; case Pos.Last: xPageRightBtnAni.gameObject.SetActive(false); xPageRightBtn.gameObject.SetActive(true); xPageLeftBtnAni.gameObject.SetActive(true); xPageLeftBtn.gameObject.SetActive(false); break; case Pos.Med: xPageRightBtnAni.gameObject.SetActive(true); xPageLeftBtnAni.gameObject.SetActive(true); xPageRightBtn.gameObject.SetActive(false); xPageLeftBtn.gameObject.SetActive(false); break; } UISpriteAnimation ani1 = xPageRightBtnAni.GetComponent <UISpriteAnimation>(); if (ani1 != null) { ani1.Reset(); } UISpriteAnimation ani2 = xPageLeftBtnAni.GetComponent <UISpriteAnimation>(); if (ani2 != null) { ani2.Reset(); } }
public static int Reset(IntPtr l) { int result; try { UISpriteAnimation uISpriteAnimation = (UISpriteAnimation)LuaObject.checkSelf(l); uISpriteAnimation.Reset(); LuaObject.pushValue(l, true); result = 1; } catch (Exception e) { result = LuaObject.error(l, e); } return(result); }
// 结算界面关闭 重置初始状态 public void Reset() { mAwarded = false; mAwardText.text = null; mAwardMask.SetActive(true); mCostPanel.SetActive(true); ApplyCardRotation(); mAwardTweener.ResetToBeginning(); mMaskTweener.ResetToBeginning(); UIAtlasHelper.SetSpriteImage(mAwardIcon, null); mAni.Reset(); mAni.gameObject.SetActive(false); }
//界面打开 protected override void OnOpen(object param = null) { mTimer = uint.MaxValue; mText3.AddOnFinished(OnText3Finished); mText2.AddOnFinished(OnText2Finished); mText1.AddOnFinished(OnText1Finished); mFight.AddOnFinished(OnFightFinished); mText3.gameObject.SetActive(true); mText3.Play(); mFight.ResetToBeginning(); mFight.gameObject.SetActive(false); mAni.Reset(); mAni.gameObject.SetActive(false); CameraController.Instance.ShakeCamera(GameConfig.LevelUpShakeCameraAmount, 0.5f); }
public static void InitLimitLoopSrpiteAnimation(UISpriteAnimation animation, int loopTime = 1) { if (animation == null) { LogSystem.LogWarning(new object[] { "animation is null" }); return; } animation.loop = false; animation.gameObject.SetActive(false); animation.Reset(loopTime); animation.m_callBack = delegate { animation.Replay(); animation.gameObject.SetActive(false); }; }
private void OnRespondForge(EventBase evt) { levbarAni.gameObject.SetActive(true); UISpriteAnimation ani = levbarAni.gameObject.GetComponent <UISpriteAnimation>(); ani.Reset(); Player ply = PlayerController.Instance.GetControlObj() as Player; int wingid = mWingMoudle.GetWingIdByIndex(CurPageNum); uint wingLevel = mWingMoudle.GetWingLevel(wingid); if (!mWingMoudle.IsReEquip) { return; } mCharacterPreview.ChangeWing(wingid, wingLevel); if (mWingMoudle.GetWingState(CurPageNum) == WingState.Wear) { ply.WingEquip(mWingMoudle.GetWingIdByIndex(CurPageNum), 0); } mWingMoudle.IsReEquip = false; }
private void OnAnimationResLoaded(string aniName) { if (!mAniDatas.ContainsKey(aniName)) { return; } List <SpriteAniParam> lst = mAniDatas[aniName]; for (int i = 0; i < lst.Count; ++i) { SpriteAniParam param = lst[i]; GameObject go = param.obj; UISprite gold = go.GetComponent <UISprite>(); gold.atlas = UIAtlasHelper.LoadAtlas(aniName); gold.MakePixelPerfect(); UISpriteAnimation spriteAni = go.GetComponent <UISpriteAnimation>(); if (spriteAni == null) { GameDebug.LogError("怎么可能出错了"); return; } spriteAni.framesPerSecond = param.fps; spriteAni.loop = param.isLoop; if (param.isSelfDestroy) { spriteAni.onFinished += DestroyObj; } spriteAni.RebuildSpriteList(); spriteAni.Reset(); go.SetActive(true); } mAniDatas.Remove(aniName); }
public void SetTop(bool top) { mTop = top; UISpriteAnimation ani = mView.mSprite.gameObject.GetComponent <UISpriteAnimation>(); if (ani == null) { ani = mView.mSprite.gameObject.AddComponent <UISpriteAnimation>(); } ani.PixelPerfect = false; if (top) { mView.mSprite.centerType = UISprite.AdvancedType.Tiled; mView.mSprite.leftType = UISprite.AdvancedType.Sliced; mView.mSprite.rightType = UISprite.AdvancedType.Sliced; mView.mSprite.bottomType = UISprite.AdvancedType.Sliced; mView.mSprite.topType = UISprite.AdvancedType.Sliced; UIAtlasHelper.SetSpriteImage(mView.mSprite, "zhushouduihua:01_000"); ani.enabled = true; ani.RebuildSpriteList(); ani.Reset(); } else { mView.mSprite.centerType = UISprite.AdvancedType.Sliced; mView.mSprite.leftType = UISprite.AdvancedType.Sliced; mView.mSprite.rightType = UISprite.AdvancedType.Sliced; mView.mSprite.bottomType = UISprite.AdvancedType.Sliced; mView.mSprite.topType = UISprite.AdvancedType.Sliced; UIAtlasHelper.SetSpriteImage(mView.mSprite, "Chat:paopao"); ani.enabled = false; } mView.mLabel.gameObject.transform.localPosition = new Vector3(0.0f, 5.0f, 0.0f); }
void startToggltAni() { mAnimation.gameObject.SetActive(true); mAnimation.Reset(); }
//是否被选中 public void SetSelect(bool select) { mSele.gameObject.SetActive(select); mSele.Reset(); }
//宝石合成成功 void onCombSucess() { mCombSuccessAni.Reset(); mCombSuccessAni.gameObject.SetActive(true); mCombSuccessAni.onFinished += onStrenSpriteAniFinish; }
protected override void OnOpen(object param = null) { base.OnOpen(param); ani.framesPerSecond = 15; ani.Reset(); }
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(); } }
// Update is called once per frame public override void Update(uint elapsed) { if (mParam == null) { return; } if (MState == UIState.Waiting) { mWaitTime += Time.deltaTime; if (!(mWaitTime >= mMaxWaitTime)) { return; } WindowManager.Instance.CloseUI("challengeDrop"); mModule.ContinueChallenge(); } else { mTimer += Time.deltaTime; switch (mCurStep) { case UIStep.STEP_ORIGINAL: { mBack.gameObject.SetActive(false); Continue.gameObject.SetActive(false); Sweep.gameObject.SetActive(false); UIAtlasHelper.SetSpriteGrey(AchieveOne.mIcon, true); UIAtlasHelper.SetSpriteGrey(AchieveTwo.mIcon, true); UIAtlasHelper.SetSpriteGrey(AchieveThree.mIcon, true); AchieveOne.Reset(); AchieveTwo.Reset(); AchieveThree.Reset(); mTimer = 0.0f; mCurStep = UIStep.STEP_Wait; mTween.resetOnPlay = true; MContainer.SetActive(false); Jilu.gameObject.SetActive(false); } break; case UIStep.STEP_Wait: { if (mTimer < STEPTIME_Wait) { return; } MContainer.SetActive(true); mTween.Play(true); mTimer = 0; mCurStep = UIStep.STEP_0; } break; case UIStep.STEP_0: { if (!(mTimer > STEPTIME_0)) { return; } mTimer = 0.0f; mCurStep = UIStep.STEP_AchieveAnim; } break; case UIStep.STEP_AchieveAnim: { if (ActionAchieve()) { return; } mTimer = 0.0f; mCurStep = UIStep.STEP_1; } break; case UIStep.STEP_1: { if (ActionScrollNum()) { return; } mTimer = 0.0f; mCurStep = UIStep.STEP_2; } break; case UIStep.STEP_2: { if (mParam.mScore > mParam.mHistortyScore) { Jilu.gameObject.SetActive(true); Jilu.Reset(); } RefreshBtn(); if (mBackTween.gameObject.activeSelf) { mBackTween.Play(true); } if (mContinueTween.gameObject.activeSelf) { mContinueTween.Play(true); } if (mSweepTween.gameObject.activeSelf) { mSweepTween.Play(true); } mTimer = 0.0f; mCurStep = UIStep.STEP_3; } break; case UIStep.STEP_3: { if (mParam.mDrops.Count > 0) { if (!(mTimer > STEPTIME_3)) { return; } mTimer = 0.0f; mCurStep = UIStep.STEP_4; } else { mTimer = 0.0f; mCurStep = UIStep.STEP_5; } } break; case UIStep.STEP_4: { mAwardW.setShow(true); mAwardW.PlayTween(); mTimer = 0.0f; mCurStep = UIStep.STEP_5; } break; case UIStep.STEP_5: break; } } }