public static void SetActiveAndAlphaFade(GameObject go, bool is_active) { bool activeSelf = go.get_activeSelf(); go.SetActive(true); TweenAlpha component = go.GetComponent <TweenAlpha>(); if (component == null) { go.SetActive(false); } else if (is_active) { if (!activeSelf) { component.value = 0f; } component.SetOnFinished((EventDelegate.Callback)null); component.PlayForward(); } else if (activeSelf && component.value > 0f) { component.SetOnFinished(delegate { go.SetActive(false); }); component.PlayReverse(); } else { component.value = 0f; go.SetActive(false); } }
private void PlayStartTurnAnim() { alphaAnim.tweenFactor = 0; alphaAnim.SetOnFinished(TweenAlphaFinish); alphaAnim.PlayForward(); ShowEffect(false); }
protected override void DarkMaskTweenStart(float targetAlpha, bool isFadeIn) { TweenAlpha tweenAlpha = TweenAlpha.Begin(DarkBackground.transform.GetChild(0).gameObject, DarkBackgroundFadeDuration, DarkBackgroundAlpha); if (isFadeIn) { tweenAlpha.SetOnFinished(base.DarkMaskFadeInFinished); } else { tweenAlpha.SetOnFinished(base.DarkMaskFadeOutFinished); } }
private void OnSwipeLeft() { TweenPosition tweenPos = gameObject.AddComponent <TweenPosition>(); tweenPos.animationCurve = ColorManagementSystemController.EasyInOutAnimCurve; Vector3 curerntPos = transform.localPosition; tweenPos.from = curerntPos; tweenPos.to = new Vector3(-_notificationModel.MainBackground.width * 1.2f, curerntPos.y, curerntPos.z); tweenPos.duration = AnimationDurationTime; tweenPos.SetOnFinished(() => Destroy(tweenPos)); TweenAlpha tween = gameObject.AddComponent <TweenAlpha>(); tween.to = 0f; tween.duration = AnimationDurationTime; if (null != OnDismissedEvent) { OnDismissedEvent(_baseCard); } tween.SetOnFinished(() => { Destroy(tween); CloseNotification(); }); }
private void OnSwipeRight() { TweenPosition tweenPos = gameObject.AddComponent <TweenPosition>(); tweenPos.animationCurve = ColorManagementSystemController.EasyInOutAnimCurve; Vector3 curerntPos = transform.localPosition; tweenPos.from = curerntPos; tweenPos.to = new Vector3(_tipsModel.BottomBackground.width * 1.2f, curerntPos.y, curerntPos.z); tweenPos.duration = AnimationDurationTime; tweenPos.SetOnFinished(() => Destroy(tweenPos)); TweenAlpha tween = gameObject.AddComponent <TweenAlpha>(); tween.to = 0f; tween.duration = AnimationDurationTime; tween.SetOnFinished(() => { Destroy(tween); CloseNotification(); }); }
public void FadeIn(float FadeTime) { base.transform.localScale = Vector3.one; TweenAlpha tweenAlpha = TweenAlpha.Begin(base.gameObject, FadeTime, 1f); tweenAlpha.SetOnFinished(OpenAnimEnd); }
public void backToCommandMenu() { SoundUtils.PlaySE(SEFIleInfos.CommonCancel1); this.DelayActionFrame(1, delegate { MainPanel.SafeGetTweenAlpha(1f, 0f, 0.3f, 0f, UITweener.Method.Linear, UITweener.Style.Once, null, string.Empty); TweenAlpha component = MainPanel.GetComponent <TweenAlpha>(); StrategyTopTaskManager.GetSailSelect().moveCharacterScreen(isEnter: false, null); component.onFinished.Clear(); component.SetOnFinished(delegate { this.DelayAction(0.15f, delegate { MainPanel.SetActive(isActive: false); TransportPanel.SetActive(isActive: false); StrategyTopTaskManager.Instance.GetInfoMng().changeCharacter(SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeck); MainPanel.DestroyEscortOrganize(); this.DelayActionFrame(3, delegate { KeyControlManager.Instance.KeyController = CommandKeyController; StrategyTopTaskManager.ReqMode(StrategyTopTaskManager.StrategyTopTaskManagerMode.CommandMenu); StrategyTaskManager.SceneCallBack(); }); }); }); Close(); isInit = false; }); }
// 倒计时结束的关闭 public void OnCloseClick() { // 进入战斗 //UISystem.Get ().FadeBattle(true); // 当前页面的渐出,透明度 TweenAlpha ta = gameObject.GetComponent <TweenAlpha> (); if (ta == null) { ta = gameObject.AddComponent <TweenAlpha> (); } ta.ResetToBeginning(); ta.from = 1; ta.to = 0; ta.duration = 0.25f; ta.SetOnFinished(() => { StartGame(); }); ta.Play(true); // 当前页面的渐出,放大 /* * TweenScale ts = gameObject.GetComponent<TweenScale> (); * if (ts == null) { * ts = gameObject.AddComponent<TweenScale> (); * } * ts.ResetToBeginning (); * ts.from = Vector3.one; * ts.to = Vector3.one * 1.25f; * ts.duration = 0.3f; * ts.Play (true); */ }
/// <summary> /// 淡入淡出窗口 /// </summary> public void FadeOutWindow2(string name) { #if !SERVER BaseWindow bw = GetWindow(name); if (bw == null) { return; } TweenAlpha ta = bw.gameObject.GetComponent <TweenAlpha>(); float a = 1; float time = 0.25f; if (ta == null) { ta = bw.gameObject.AddComponent <TweenAlpha> (); } else { a = ta.value; time *= a; } ta.ResetToBeginning(); ta.from = a; ta.to = 0; ta.duration = time; ta.SetOnFinished(() => { UISystem.Get().HideWindow(name); }); ta.Play(true); #endif }
void fadeOut() { TweenAlpha ta = TweenAlpha.Begin(mGo, mFadeOutDur, 0f); ta.SetOnFinished(onFadeOut); ta.PlayForward(); }
public void FadeIn(float FadeTime) { base.get_transform().set_localScale(Vector3.get_one()); TweenAlpha tweenAlpha = TweenAlpha.Begin(base.get_gameObject(), FadeTime, 1f); tweenAlpha.SetOnFinished(new EventDelegate.Callback(this.OpenAnimEnd)); }
public IEnumerator Play(int MstID, Action OnFinished) { panel.alpha = 1f; MotionList = new Dictionary <int, Live2DModel.MotionType>(); MotionList.Add(9, Live2DModel.MotionType.Love2); MotionList.Add(37, Live2DModel.MotionType.Port); MotionList.Add(1, Live2DModel.MotionType.Port); MotionList.Add(33, Live2DModel.MotionType.Port); MotionList.Add(96, Live2DModel.MotionType.Secret); MotionList.Add(43, Live2DModel.MotionType.Port); MotionList.Add(54, Live2DModel.MotionType.Battle); MotionList.Add(55, Live2DModel.MotionType.Port); MotionList.Add(56, Live2DModel.MotionType.Secret); MotionList.Add(94, Live2DModel.MotionType.Secret); MotionList.Add(46, Live2DModel.MotionType.Secret); if (MotionList.ContainsKey(MstID)) { Live2DModel.MotionType motionType = MotionList[MstID]; } SoundUtils.StopBGM(); SingletonMonoBehaviour <FadeCamera> .Instance.SetTransitionRule(FadeCamera.TransitionRule.NONE); ShipModelMst model = new ShipModelMst(MstID); ShipCharacter.ChangeCharacter(model); yield return(new WaitForEndOfFrame()); yield return(new WaitForEndOfFrame()); yield return(new WaitForEndOfFrame()); SoundUtils.PlaySE(SEFIleInfos.RewardGet2, null); WhiteMaskTweenAlpha.ResetToBeginning(); WhiteMaskTweenAlpha.PlayForward(); WhiteMaskTweenAlpha.SetOnFinished(delegate { throw new NotImplementedException("‚È‚É‚±‚ê"); // SingletonMonoBehaviour<Live2DModel>.Instance.Play(base._003Cmotion_003E__0, null); ShipUtils.PlayShipVoice(model, 1); }); yield return(new WaitForSeconds(6f)); BGTweenAlpha.ResetToBeginning(); BGTweenAlpha.PlayForward(); CameraZoomTween.ResetToBeginning(); CameraZoomTween.PlayForward(); yield return(new WaitForSeconds(4.5f)); WhiteMaskTweenAlpha.onFinished.Clear(); WhiteMaskTweenAlpha.PlayReverse(); yield return(new WaitForSeconds(WhiteMaskTweenAlpha.duration + 2f)); TweenColor.Begin(WhiteMaskTweenAlpha.gameObject, 1f, Color.black); yield return(new WaitForSeconds(1.5f)); OnFinished?.Invoke(); }
private void OnComplete() { ta.onFinished.Clear(); ta = TweenAlpha.Begin(base.gameObject, 0.5f, 0f); ta.SetOnFinished(delegate { base.transform.localPosition = defaultPos; myPanel.widgetsAreStatic = true; }); ta.delay = hideDelay; }
void TweenAplha() { CancelInvoke("GetTime"); TweenAlpha alpha = TweenAlpha.Begin(gameObject, 0.5f, 0); alpha.PlayForward(); alpha.SetOnFinished(delegate() { Destroy(gameObject); }); }
public void EndTransition(Action act, bool isLockTouchOff = true, bool isPortFrameColliderEnable = true) { if (!this.isOver) { SingletonMonoBehaviour <FadeCamera> .Instance.FadeIn(0.2f, delegate { if (SingletonMonoBehaviour <UIShortCutMenu> .exist()) { SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = true; SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockOffControl(); SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockTouchControl(!isLockTouchOff); } if (act != null) { act.Invoke(); act = null; this.SetActiveChildren(false); } if (SingletonMonoBehaviour <UIPortFrame> .exist() && isPortFrameColliderEnable) { SingletonMonoBehaviour <UIPortFrame> .Instance.isColliderEnabled = true; } this.isTransitionNow = false; }); return; } TweenAlpha tweenAlpha = TweenAlpha.Begin(this.TransitionPanel.get_gameObject(), 0.4f, 0f); tweenAlpha.onFinished.Clear(); tweenAlpha.SetOnFinished(delegate { if (SingletonMonoBehaviour <UIShortCutMenu> .exist()) { SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = true; Debug.Log("transitionEnd"); SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockOffControl(); SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockTouchControl(!isLockTouchOff); } this.TransitionPanel.SetRect(0f, 0f, 0.1f, 0.1f); if (act != null) { act.Invoke(); act = null; this.SetActiveChildren(false); } if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.isColliderEnabled = true; } this.isOver = false; this.isTransitionNow = false; }); }
private void ProcPlayTweenAlpha(float fFadeDelay, float fFadeDuration) { _pTweenAlpha.ResetToBeginning(); _pTweenAlpha.from = 1f; _pTweenAlpha.to = 0f; _pTweenAlpha.duration = fFadeDuration; _pTweenAlpha.delay = fFadeDelay; _pTweenAlpha.SetOnFinished(OnFinish_TweenAlpha); _pTweenAlpha.PlayForward(); }
public void setVisible(bool isVisible) { if (this.isVisible == isVisible) { return; } this.isVisible = isVisible; if (isVisible) { TweenAlpha ta = base.GetComponent <TweenAlpha>(); ta.onFinished.Clear(); ta.to = 1f; ta.from = 0f; ta.duration = 1f; ta.style = UITweener.Style.Once; ta.SetOnFinished(delegate { ta.onFinished.Clear(); ta.from = 1f; ta.to = 0.6f; ta.style = UITweener.Style.PingPong; ta.duration = 2f; ta.ResetToBeginning(); this.DelayActionFrame(1, delegate { ta.PlayForward(); }); }); ta.ResetToBeginning(); this.DelayActionFrame(1, delegate { ta.PlayForward(); }); } else { TweenAlpha ta = base.GetComponent <TweenAlpha>(); ta.onFinished.Clear(); ta.duration = 0.3f; ta.from = base.GetComponent <UIWidget>().alpha; ta.to = 0f; ta.style = UITweener.Style.Once; ta.ResetToBeginning(); ta.SetOnFinished(delegate { }); this.DelayActionFrame(1, delegate { ta.PlayForward(); }); } }
public void UpdateDialogBlocker(GameSectionHierarchy hierarchy, GameSceneTables.SectionData new_section_data) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown GameObject blocker = system.GetCtrl(SYSTEM.DIALOG_BLOCKER).get_gameObject(); int dialogDialogBlockerDepth = hierarchy.GetDialogDialogBlockerDepth(new_section_data); int num = 3000; if (dialogDialogBlockerDepth > -1) { blocker.SetActive(true); dialogBlockerTween.SetOnFinished((EventDelegate.Callback)null); dialogBlockerTween.PlayForward(); blocker.GetComponent <UIPanel>().depth = dialogDialogBlockerDepth; } else { dialogBlockerTween.SetOnFinished(delegate { blocker.SetActive(false); }); dialogBlockerTween.PlayReverse(); if (blocker.get_activeSelf()) { num = -1; } } if (num > -1) { if (mainMenu != null) { mainMenu.baseDepth = num; } if (mainStatus != null) { mainStatus.baseDepth = num; } } }
private void PlayHpFlying() { UILabel label = null; if (_queueHpLabel.Count > 0) { label = _queueHpLabel.Dequeue(); } else { label = ResourceMgr.Instance.LoadAndInstanceGameObjectFromPreload(FightDefine.LabelHPFlying).GetComponent <UILabel>(); } TweenAlpha tweenAlpha = label.GetComponent <TweenAlpha>(); tweenAlpha.ResetToBeginning(); TweenPosition tweenPos = label.GetComponent <TweenPosition>(); tweenPos.ResetToBeginning(); label.text = (-ModuleFight.CLEINT_DAMAGE).ToString(); label.transform.SetParent(TransHpFlyPos); label.transform.localPosition = new Vector3(0, -0.3f, 0); label.transform.localScale = Vector3.one * 0.005f; label.depth = 213; // Color color = label.color; // color.a = 1f; // label.color = color; tweenPos.delay = Random.Range(0, 500) / 1000f; tweenPos.enabled = true; tweenAlpha.enabled = true; tweenPos.PlayForward(); tweenAlpha.PlayForward(); tweenAlpha.SetOnFinished( () => { label.transform.parent = null; if (_transHpFly != null) { _queueHpLabel.Enqueue(label); } else { Destroy(label.gameObject); } }); }
void CallbackColseWindow0() { if (mPanel != null) { mPanel.transform.gameObject.SetActive(false); } if (mTween1 != null) { mTween1.delay = 0f; mTween1.ResetToBeginning(); mTween1.SetOnFinished(CallbackColseWindow); mTween1.Toggle(); } }
private void HideRecommendationWindow() { TweenAlpha tween = _notificationModel.RecommendationNotificationContainer.GetComponent <TweenAlpha>(); if (null == tween) { throw new MissingComponentException( "RecommendationNotificationController.HideRecommendationWindow - Missing TweenAlpha component"); } tween.PlayForward(); tween.SetOnFinished( () => NGUITools.SetActive(_notificationModel.RecommendationNotificationContainer.gameObject, false)); }
private IEnumerator update() { while (!isEnd) { Arrow.transform.LookAt2D(TargetTilePos, Vector2.up); moveArrow(); yield return(new WaitForEndOfFrame()); } TweenAlpha ta = TweenAlpha.Begin(Arrow.gameObject, 0.2f, 0f); ta.SetOnFinished(delegate { Object.Destroy(this.gameObject); }); }
public IEnumerator Close() { TweenAlpha ta = TweenAlpha.Begin(base.gameObject, 0.4f, 0f); ta.onFinished.Clear(); ta.SetOnFinished(delegate { throw new NotImplementedException("‚È‚É‚±‚ê"); // base._003CisFinished_003E__0 = true; UnityEngine.Object.Destroy(this.gameObject); }); ta.PlayForward(); yield return(null); }
private void HideEntireComponents() { TweenAlpha tween = _tipsModel.BottomContainer.GetComponent <TweenAlpha>(); if (null == tween) { throw new MissingComponentException( "NotificationTipsController.OpenNotification - Missing TweenScale component"); } _tipsModel.State = NotificationTipsModel.NotificationTipsState.OpenAndDismissed; tween.PlayReverse(); tween.SetOnFinished(HideAndCloseNotification); }
private void OnClosedShutterEventForEndOfPractice() { mUIDeckPracticeProductionMovieClip.Stop(); mUIDeckPracticeShutter.SetOnFinishedCloseShutterAnimationListener(null); DOVirtual.DelayedCall(0.8f, delegate { mTween_EndMessage.SetOnFinished(delegate { ChangeNextMovableState(); }); mTween_EndMessage.gameObject.SetActive(true); mTween_EndMessage.PlayForward(); }); mUIDeckPracticeProductionMovieClip.SetActive(isActive: false); }
private IEnumerator Start() { while (!MonoBehaviourSingleton <UIManager> .IsValid() || MonoBehaviourSingleton <UIManager> .I.isLoading) { yield return((object)null); } faderPanel = MonoBehaviourSingleton <UIManager> .I.faderPanel; faderTexture = MonoBehaviourSingleton <UIManager> .I.system.GetCtrl(UIManager.SYSTEM.FADER).GetComponent <UITexture>(); faderSprite = MonoBehaviourSingleton <UIManager> .I.system.GetCtrl(UIManager.SYSTEM.FADER).GetComponent <UISprite>(); faderTweenAlpha = MonoBehaviourSingleton <UIManager> .I.system.GetCtrl(UIManager.SYSTEM.FADER).GetComponent <TweenAlpha>(); faderTweenAlpha.SetOnFinished(new EventDelegate(OnFaderTweenFinised)); faderTweenAlpha.get_gameObject().SetActive(false); }
public void StartSingleGame() { TweenAlpha ta = gameObject.GetComponent <TweenAlpha>(); if (ta == null) { ta = gameObject.AddComponent <TweenAlpha>(); } ta.ResetToBeginning(); ta.from = 1f; ta.to = 0; ta.duration = 0.5f; ta.SetOnFinished(() => { EventSystem.Instance.FireEvent(EventId.UpdateChaptersView, 1); }); }
void GiveUp() { TweenAlpha ta = gameObject.GetComponent <TweenAlpha> (); if (ta == null) { ta = gameObject.AddComponent <TweenAlpha> (); } ta.ResetToBeginning(); ta.from = 1; ta.to = 0; ta.duration = 0.2f; ta.SetOnFinished(() => { BattleSystem.Instance.PlayerGiveUp(); }); ta.Play(true); }
private void AnimationClose(Action action) { TweenAlpha tweenAlpha = UITweener.Begin <TweenAlpha>(base.gameObject, 0.3f); tweenAlpha.from = 1f; tweenAlpha.to = 0.01f; tweenAlpha.ignoreTimeScale = false; tweenAlpha.SetOnFinished(delegate { if (action != null) { action(); } UnityEngine.Object.Destroy(tweenAlpha); }); tweenAlpha.PlayForward(); }
public void TileColorRefresh(Action Onfinished) { this.TileButton.set_enabled(false); TweenAlpha tweenAlpha = TweenAlpha.Begin(this.GrowTile.get_gameObject(), 3f, 0f); tweenAlpha.onFinished.Clear(); tweenAlpha.SetOnFinished(delegate { this.TileButton.set_enabled(true); this.TileButton.defaultColor = Color.get_clear(); this.TileButton.hover = Color.get_clear(); this.TileButton.pressed = Color.get_clear(); if (Onfinished != null) { Onfinished.Invoke(); } }); }