public void OnButtonAltar_Click() { if (GameManager.tutorial.step < TutorialManager.TutorialStep.Finished) { uiTutorial.arrowHero.SetActive(false); if (GameManager.tutorial.step < TutorialManager.TutorialStep.BuyHero_Exit) { return; } if (GameManager.tutorial.step >= TutorialManager.TutorialStep.Control_NPCFinshed && GameManager.tutorial.step < TutorialManager.TutorialStep.Equip_Begin) { return; } } HideAllSubButton(); UIPlayTween tween = uiTutorial.btnAltar.GetComponent <UIPlayTween>(); tween.tweenTarget = uiTutorial.btnAltar_Hero.gameObject; tween.Play(true); tween.tweenTarget = uiTutorial.btnAltar_UpLevel.gameObject; tween.Play(true); tween.tweenTarget = uiTutorial.btnAltar_UpStar.gameObject; tween.Play(true); tween.tweenTarget = uiTutorial.btnInfoAltar.gameObject; tween.Play(true); }
void GroupOneTweenPos()//로테이션 다음에 가운데로 움직임 { PlayTween.tweenGroup = 1; PlayTween.Play(true); EventDelegate.Set(PlayTween.onFinished, GroupTwoTweenPos); }
protected override void OnFreshView() { if (Data == null) { return; } else if (Data is MatchItemData) { _curData = Data as MatchItemData; if (TweenPlay) { if (_tweenState) { if (_curData.NeedCloseWhenLoad) { _tweenState = false; TweenPlay.Play(_tweenState); } else { _curData.NeedCloseWhenLoad = true; } } } ShowMainUi(); } else if (Data is Dictionary <string, object> ) { ShowDetailInfo(); } }
void ShowNextStep() { // tweenPlayer.resetOnPlay = true; // tweenPlayer.tweenGroup = 1; // tweenPlayer.Play (false); NGUITools.SetActive(m_NextStepObj, true); // for (int i = 0; i < m_RoleBgObj.Length; i++) // { // m_RoleBgObj[i].GetComponent<UITexture>().alpha = 0; // } SetBGDepth(m_CurRoleIndex); UIPlayTween curTweenPlay = m_RoleBgObj [m_CurRoleIndex].GetComponent <UIPlayTween> (); curTweenPlay.tweenGroup = 3; curTweenPlay.resetOnPlay = true; curTweenPlay.Play(true); m_ZhiYeMgr.resetOnPlay = true; m_ZhiYeMgr.Play(true); //NGUITools.SetActive(m_RoleBgObj[m_CurRoleIndex], true); m_ChangePersonObj.BeginChangePlayer(firstBlurredTrans, m_RoleItemObj[m_CurRoleIndex].transform); IsClickSelectRole = false; AdaptBg(); }
void onSelectOneRoleItem(int index) { if (index == 2)//弓箭手 { GUIData.AddNotifyData("#{10012}"); return; } if (IsClickSelectRole == true) { return; } IsClickSelectRole = true; NGUITools.SetActive(bgButton1Obj, false); NGUITools.SetActive(bgButton2Obj, true); tweenPlayer.tweenGroup = 1; tweenPlayer.Play(true); //Debug.Log("curselectinde " + index); // NGUITools.SetActive(m_FirstStepObj, false); m_CurRoleIndex = index; SetRoleProfessional(m_CurRoleIndex); FreshNewName(); Invoke("ShowNextStep", 0.7f); }
// Update is called once per frame void Update() { if (bInit == true && bDelayedShow == true) { bDelayedShow = false; m_TWShow.Play(true); //播放一个窗口的效果 } }
public void EnterSideShips() { UpdateBanners(); GetComponent <UIWidget>().alpha = 1f; setPosition(toScreenIn: true); PlayTween.resetOnPlay = true; PlayTween.Play(forward: true); }
private IEnumerator Start() { yield return(new WaitForEndOfFrame()); swipeEvent.enabled = false; cancelTouch.enabled = false; PlayTween.Play(forward: false); Menus.SetActive(false); }
public void TweenerGroupIn() { TweenerGroup.playDirection = AnimationOrTween.Direction.Forward; UITweener[] tws = TweenerGroup.GetComponentsInChildren <UITweener> (); foreach (UITweener each in tws) { each.delay = 0.4f; } TweenerGroup.Play(true); }
/** 公告条目进入动画 */ public void tweenerArrowGroupIn() { tweenerArrow.playDirection = AnimationOrTween.Direction.Forward; UITweener[] tws = tweenerArrow.GetComponentsInChildren <UITweener> (); foreach (UITweener each in tws) { each.delay = delayTime; } //第一次进入为3秒停留,之后为0.4f delayTime = 0.4f; tweenerArrow.Play(true); }
private void OnShowMainUI() { SoundManager.Instance.Play(15); mRankLeftTween.to.Set(-Screen.width, 0, 0); mRankRightTween.to.Set(Screen.width, 0, 0); mRankTween.Play(true); }
private void OnRequestRank() { SoundManager.Instance.Play(15); mChalModule.RequestRankList(); mMainTweenPos.to.Set(-Screen.width * 1.5f, 0, 0); mMainTween.Play(true); }
public void OnButtonUseItem_Click() { int amount = 0; if (!int.TryParse(lblUseItem_amount.value, out amount)) { return; } if (amount > userItem.Count) { MessageBox.ShowDialog(GameManager.localization.GetText("Hero_Inventory_UseItem_Insufficient"), UINoticeManager.NoticeType.Message); return; } GameManager.GameUser.SetItemForRole(userRole, userItem, amount); heroManager.OnUseItem(userItem, amount); UserItem gameUserIem = GameManager.GameUser.UserItems.FirstOrDefault(p => p.Id == userItem.Id); if (gameUserIem != null && userItem != null) { gameUserIem.Count = userItem.Count; } if (gameUserIem != null) { if (gameUserIem.Count <= 0) { GameManager.GameUser.UserItems.Remove(gameUserIem); } } playTweenClose.Play(true); }
/// <summary> /// 点击的点是否在道具区域内,如果不再,道具打开了就关闭 /// </summary> /// <param name="screenPos"></param> void PointInRectEvent(Vector3 screenPos) { if (this.gameObject.activeSelf == false) { return; } if (m_fixItemCount == m_allItemCount) { return; } Vector3 worldPos = UICamera.currentCamera.ScreenToWorldPoint(screenPos); //屏幕坐标到世界坐标 Vector3 point = m_widget_shortcutRect.transform.worldToLocalMatrix.MultiplyPoint(worldPos); //transform的相对坐标 Bounds bound = m_widget_shortcutRect.CalculateBounds(); if (bound.Contains(point) == false) { bool show = m_trans_shortcutContent.transform.localPosition.x == 40 + 67 * (3 - m_movableItemCount); if (show) { Vector3 setPos = new Vector3(240, m_trans_shortcutContent.transform.localPosition.y, 0); TweenPosition.Begin(m_trans_shortcutContent.gameObject, 0.2f, setPos); UIPlayTween playTween = m_btn_BtnArrow.GetComponent <UIPlayTween>(); if (playTween != null) { playTween.Play(true); } } } }
/// <summary> /// Somebody asked me why don't I put these two functions together and give a parameter to control the behaviour. /// Well, I think you had better ask NGUI instead. /// </summary> public void StartMoving() { isAnimating = true; m_button.isEnabled = false; tweenComponent.Play(true); Debug.Log("Started! "); }
public void Close(bool bForce = false, bool bImmediately = false) //关闭弹出框 { if (GetCurrentPopup() == null) { return; } if (bShow == false) { return; } if (bForce == true || GetCurrentPopup().bExternalClose == true) { if (bImmediately == true) { PopPopup().SetActive(false); if (GetCurrentPopup() == null) { gameObject.SetActive(false); } else { Show(); } } else { m_TWHide.Play(true); } } }
public void Show(bool is_new = false, bool bImmediately = false) //展现弹出框 { InitCurrentPopup(is_new); gameObject.SetActive(true); m_TWBlock.gameObject.SetActive(true); contents.transform.localScale = Vector3.one; GetCurrentPopup().SetActive(true); if (bInit == true) { if (bImmediately) { m_TWImmediately.Play(true); } else { m_TWShow.Play(true); } } else { bDelayedShow = true; } }
public void OnSelectedRoleForUpgrade(UIHeroSlotChoseForUpgrade uiHeroChose) { if (_heroSlotForUpgradeChose != null) { _heroSlotForUpgradeChose.OnDeSelected(); } _heroSlotForUpgradeChose = uiHeroChose; _curRoleUpgrade = _heroSlotForUpgradeChose._userRole; if (_curRoleUpgrade.Base.Grade >= maxGrade) { MessageBox.ShowDialog(GameManager.localization.GetText("ErrorCode_UpStart_MaxGrade"), UINoticeManager.NoticeType.Message); statsManager.SetRole(_curRoleUpgrade, _curRoleUpgrade); return; } ShowCurRoleUpgrade(); GetItemsRequire(); effectManager.resourceCount = itemsRequire.Count; ShowInfo(); ShowItem(); arrowSelectHero.SetActive(false); arrowButton.SetActive(true); tweenHideHero.Play(true); }
public override void Update(uint elapsed) { mTimer += Time.deltaTime; switch (mCurStep) { case UIStep.STEP_ORIGINAL: { IconTween.resetOnPlay = true; mTimer = 0.0f; mCurStep = UIStep.STEP_0; } break; case UIStep.STEP_0: { IconTween.Play(true); mTimer = 0.0f; mCurStep = UIStep.STEP_Stop; } break; case UIStep.STEP_Stop: { } break; } }
public void OnToogleAuto() { Controller curController = TouchController.instance.controllerGetSkill; if (curController == null) { uiToggleAuto.value = false; return; } else { StateManager stateManager = curController.GetComponent <StateManager>(); stateManager.enabled = uiToggleAuto.value; if (uiToggleAuto.value == true) { if (GameManager.battleType == BattleMode.Challenge || GameManager.battleType == BattleMode.RandomPvP) { return; } UIPlayTween playTween = new UIPlayTween(); playTween.tweenTarget = chkAutoSkill.gameObject; playTween.playDirection = AnimationOrTween.Direction.Forward; playTween.ifDisabledOnPlay = AnimationOrTween.EnableCondition.EnableThenPlay; playTween.disableWhenFinished = AnimationOrTween.DisableCondition.DoNotDisable; playTween.Play(true); } else { tweenclose.Play(true); } } }
public void OnClick_System(UI_ChapterUnit cu) { GameApp.Instance.SoundInstance.PlaySe("button"); for (int i = 0; i < cu.transform.parent.childCount; i++) { Transform child = cu.transform.parent.GetChild(i); child.GetComponent <UI_ChapterUnit>().Bg.spriteName = "bg_yeqian_2"; if (child.name != cu.transform.name) { Transform TweenTrans = child.Find("Tween"); if (TweenTrans.gameObject.activeSelf) { UIPlayTween pt = child.GetComponent <UIPlayTween>(); pt.Play(false); for (int j = 0; j < TweenTrans.childCount; j++) { Transform child2 = TweenTrans.GetChild(j); if (child2.name == "Bg") { continue; } child2.GetComponent <UISprite>().spriteName = "fujiaxuanxiang_0"; } } } } cu.Bg.spriteName = "bg_yeqian_1"; StartCoroutine("_SwitchSystemCD"); MyTools.DestroyChildNodes(AlternativeGrid.transform); }
//显示 public void Show(string text, Action confirmCallback = null) { myGameObject.SetActive(true); label.text = text; playTween.Play(true); this._confirmCallback = confirmCallback; }
public void Enable() { UIPlayTween[] tweens = ContainTweens.GetComponentsInChildren <UIPlayTween> (); for (int i = 0; i < tweens.Length; i++) { tweens [i].Play(true); // = true; } //MissionBtn.GetComponentInChildren<MissionScript> ().MissionPause (); ObjMan.enableTouch = false; playDisable.playDirection = Direction.Forward; playDisable.Play(true); EngineAnimation.Pause(); if (level == 10) { AnswerOptions.playDirection = Direction.Reverse; AnswerOptions.Play(true); } countDown.pauseTime = true; }
IEnumerator Close() { yield return(new WaitForSeconds(delayTime)); root.duration = speedClose; UIPlayTween close = new UIPlayTween(); close.tweenTarget = root.gameObject; close.playDirection = AnimationOrTween.Direction.Reverse; close.ifDisabledOnPlay = AnimationOrTween.EnableCondition.EnableThenPlay; close.disableWhenFinished = AnimationOrTween.DisableCondition.DisableAfterReverse; close.Play(true); if (GameManager.tutorial.step == TutorialManager.TutorialStep.Control_NPCFinshed && _waveIndex == 0) { UIBattleManager.Instance.OnBattleStart(); } else { GameplayManager.Instance.ResumeGame(); yield return(new WaitForSeconds(1)); StartCoroutine(GameplayManager.Instance.CreateMobsNextWave()); } }
// Use this for initialization void OnEnable() { if (bPlayTween) { bPlayTween = false; m_TWTargetItem.Play(true); } }
public void GameWin() { textureWidget.alpha = 0; // Unable star touch SwitchStarsBoxCollider(false); // Start scale winTween.Play(true); }
public void OnButtonArena_Click() { if (GameManager.tutorial.step < TutorialManager.TutorialStep.Finished) { return; } HideAllSubButton(); UIPlayTween tween = uiTutorial.btnArena.GetComponent <UIPlayTween>(); tween.tweenTarget = uiTutorial.btnArena_Arena.gameObject; tween.Play(true); tween.tweenTarget = uiTutorial.btnInfoArena.gameObject; tween.Play(true); }
public virtual void Play() { gameObject.SetActive(true); if (m_Tween != null) { m_Tween.Play(true); } }
private void Hide() { foreach (GameObject go in uiGroupTween) { _playTween.tweenTarget = go; _playTween.Play(true); } }
void OnClickSubItem(int index, bool active, bool select) { if (!active || !select) { return; } selectedIndex = index; playTween.Play(true); }
//显示UI public static void Show(UIPlayTween ui) { ui.playDirection = AnimationOrTween.Direction.Forward; ui.Play(true); }
//隐藏UI public static void Hide(UIPlayTween ui) { ui.playDirection = AnimationOrTween.Direction.Reverse; ui.Play(true); }