public void PlayShipBannerIn() { DOVirtual.DelayedCall(1.3f, delegate { Sequence s = DOTween.Sequence(); for (int i = 0; i < mUIDeckPracticeBanners.Length; i++) { UIDeckPracticeBanner banner = mUIDeckPracticeBanners[i]; Vector3 localPosition = banner.transform.localPosition; float x = localPosition.x; Transform transform = banner.transform; Vector3 localPosition2 = banner.transform.localPosition; transform.localPositionX(localPosition2.x - 80f); Tween t = banner.transform.DOLocalMoveX(x, 0.5f).SetEase(Ease.OutCirc); Tween t2 = DOVirtual.Float(banner.alpha, 1f, 0.3f, delegate(float alpha) { banner.alpha = alpha; }); Sequence sequence = DOTween.Sequence(); sequence.Join(t); sequence.Join(t2); sequence.SetDelay(0.05f); s.Join(sequence); } }); }
public IEnumerator InitializeCoroutine(DeckModel deckModel, DeckPracticeResultModel deckPracticeResultModel) { mDeckPracticeResultModel = deckPracticeResultModel; mUIDeckPracticeProductionShipParameterResult.Initialize(mDeckPracticeResultModel); yield return(new WaitForEndOfFrame()); mUIDeckPracticeProductionMovieClip = NGUITools.AddChild(mTransform_DeckPracticeProductionArea.gameObject, mPrefab_UIDeckPracticeProductionMovieClip.gameObject).GetComponent <UIDeckPracticeProductionMovieClip>(); mUIDeckPracticeProductionMovieClip.Initialize(deckModel, deckPracticeResultModel); mUIDeckPracticeProductionMovieClip.transform.localPosition = Vector3.zero; mUIDeckPracticeProductionMovieClip.SetOnShipParameterUpEventListener(OnShipParameterUpEventListener); mUIDeckPracticeProductionMovieClip.SetOnFinishedProductionListener(OnFinishedProduction); yield return(new WaitForEndOfFrame()); mStateManager = new StateManager <State>(State.None); mStateManager.OnPush = OnPushState; mStateManager.OnSwitch = OnSwitchState; List <UIDeckPracticeBanner> banners = new List <UIDeckPracticeBanner>(); for (int index = 0; index < mUIDeckPracticeBanner_Banners.Length; index++) { UIDeckPracticeBanner banner = mUIDeckPracticeBanner_Banners[index]; banner.alpha = 0.0001f; if (index < deckModel.Count) { banner.Initialize(deckModel.GetShip(index)); banners.Add(banner); } } mUIDeckPracticeBanners = banners.ToArray(); yield return(new WaitForEndOfFrame()); }
private void OnShipParameterUpEventListener(ShipModel shipModel, ShipExpModel shipExpModel, PowUpInfo powUpInfo) { UIDeckPracticeBanner uIDeckPracticeBanner = mUIDeckPracticeBanners.First((UIDeckPracticeBanner shipBanner) => shipBanner.Model.MemId == shipModel.MemId); if (!powUpInfo.IsAllZero()) { uIDeckPracticeBanner.PlayPracticeWithLevelUp(); } else { uIDeckPracticeBanner.PlayPractice(); } }