private IEnumerator AnimationCoroutine(UniRx.IObserver <int> observer) { if (_isAnimating) { observer.OnNext(0); observer.OnCompleted(); yield break; } _isAnimating = true; _binding._smoke.enableEmission = true; _anim._shine = 0f; yield return(new WaitForSeconds(_params._delay)); string anim = "FlareBullet"; _binding._animation.Play(anim); yield return(new WaitForSeconds(_binding._animation.GetClip(anim).length)); _binding._smoke.enableEmission = false; yield return(new WaitForSeconds(3f)); _anim._shine = 0f; _isAnimating = false; observer.OnNext(0); observer.OnCompleted(); }
private IEnumerator AnimationCoroutine(UniRx.IObserver <int> observer) { if (_isAnimating) { observer.OnNext(0); observer.OnCompleted(); yield break; } _isAnimating = true; _searchLightFocus = default(SearchLightFocus); _searchLightFocus.isEval = true; _referenceCameraTransform.transform.eulerAngles = Vector3.zero; string anim = "SearchLightFocusAndBack"; _animation.Play(anim); throw new NotImplementedException("‚È‚É‚±‚ê"); // yield return new WaitForSeconds(_animation.get_Item(anim).length); yield return(new WaitForSeconds(0)); _searchLightFocus.isEval = false; _isAnimating = false; observer.OnNext(0); observer.OnCompleted(); }
private IEnumerator AnimationCoroutine(UniRx.IObserver <int> observer) { if (_isAnimating) { observer.OnNext(0); observer.OnCompleted(); yield break; } _isAnimating = true; DebugUtils.dbgAssert(_shakeCurve.length >= 1); float duration = _shakeCurve.keys[_shakeCurve.length - 1].time; float beginTime = Time.time; Transform transform = base.transform; Vector3 initialPosition = transform.localPosition; while (true) { float t = Time.time - beginTime; if (t > duration) { break; } float basePower = _shakeCurve.Evaluate(t); float rt = t * (float)Math.PI * 2f * 20f; float rn = Mathf.PerlinNoise(t * 8f, 0f) * (float)Math.PI * 2f; Vector3 direction = new Vector3(Mathf.Cos(rt + rn), Mathf.Sin(rt + rn), 0f); transform.localPosition = initialPosition + direction * basePower * _shakePower; yield return(null); } transform.localPosition = initialPosition; _isAnimating = false; observer.OnNext(0); observer.OnCompleted(); }
private IEnumerator AnimationCoroutine(UniRx.IObserver <int> observer) { if (_isAnimating) { observer.OnNext(0); observer.OnCompleted(); yield break; } _isAnimating = true; _anim = default(Anim); _anim.isEval = true; _beginRotation = Quaternion.LookRotation(-DirectionXZ); string anim = "TurnAnimation"; _animation.Play(anim); throw new NotImplementedException("‚È‚É‚±‚ê"); //yield return new WaitForSeconds(_animation.get_Item(anim).length); yield return(new WaitForSeconds(0)); _anim.isEval = false; _isAnimating = false; observer.OnNext(0); observer.OnCompleted(); _beginRotation = null; }
private IEnumerator PlayDecideAnimation(UniRx.IObserver <bool> observer) { yield return(null); _listDifficultyBtn.ForEach(delegate(UIDifficultyBtn x) { // _003CPlayDecideAnimation_003Ec__Iterator1A0 _003CPlayDecideAnimation_003Ec__Iterator1A = this; if (x.index == this._nIndex) { UIWritingBrush uIWritingBrush = UIWritingBrush.Instantiate(this._prefabUIWritingBrush.GetComponent <UIWritingBrush>(), this.transform); uIWritingBrush.transform.position = x.wrightBrushAnchor.position; uIWritingBrush.Play(delegate { Observable.Timer(TimeSpan.FromSeconds(1.0)).Subscribe(delegate { observer.OnNext(value: true); observer.OnCompleted(); }); }); x.ShowDifficultyRedLabel(); } else { x.transform.LTValue(1f, 0.5f, 0.2f).setEase(LeanTweenType.linear).setOnUpdate(delegate(float y) { x.widget.alpha = y; }); } }); }
protected override IEnumerator AnimationObserver(UniRx.IObserver <bool> observer) { UIMapManager uimm = SortieMapTaskManager.GetUIMapManager(); UIAreaMapFrame uiamf = SortieMapTaskManager.GetUIAreaMapFrame(); UISortieShipCharacter uissc = SortieMapTaskManager.GetUIShipCharacter(); bool isWait = true; uissc.SetInDisplayNextMove(isInDisplay: false); uiamf.SetMessage("艦隊の前方にうずしおが発生しました!"); yield return(Observable.NextFrame(FrameCountType.EndOfFrame).StartAsCoroutine()); uimm.nextCell.PlayMailstrom(uimm.sortieShip, _clsEventHappeningModel, delegate { base._003CisWait_003E__3 = false; }); while (isWait) { yield return(null); } uiamf.SetMessage(string.Format((!_clsEventHappeningModel.Dentan) ? "{0}x{1}を\n落としてしまいました…。" : "{0}x{1}を\n落としてしまいました…。\n(電探が役立って、被害を抑えられた!)", SortieUtils.ConvertMatCategory2String(_clsEventHappeningModel.Material), _clsEventHappeningModel.Count)); yield return(Observable.Timer(TimeSpan.FromSeconds(2.0)).StartAsCoroutine()); uiamf.ClearMessage(); observer.OnNext(value: true); observer.OnCompleted(); }
//protected override IEnumerator AnimationObserver(IObserver<bool> observer) protected IEnumerator AnimationObserver(UniRx.IObserver <bool> observer) { MapManager mm = SortieBattleTaskManager.GetMapManager(); UIMapManager uimm = SortieMapTaskManager.GetUIMapManager(); UIAreaMapFrame uiamf = SortieMapTaskManager.GetUIAreaMapFrame(); UISortieShipCharacter uissc = SortieMapTaskManager.GetUIShipCharacter(); bool isShipWait = true; bool isItemGetWait = true; string empty = string.Empty; string str = (!_clsEventItemModel.IsMaterial()) ? $"{SortieUtils.ConvertItem2String(_clsEventItemModel.ItemID)}x{_clsEventItemModel.Count.ToString()}\nを入手しました!" : $"{SortieUtils.ConvertMatCategory2String(_clsEventItemModel.MaterialCategory)}x{_clsEventItemModel.Count.ToString()}\nを入手しました!"; uiamf.SetMessage(str); yield return(null); uissc.SetShipData(GetTargetShip(mm.Deck)); uissc.ShowInItemGet(delegate { throw new NotImplementedException("なにこれ"); // base._003CisShipWait_003E__4 = false; }); uissc.SetInDisplayNextMove(isInDisplay: false); uimm.sortieShip.PlayGetMaterialOrItem(_clsEventItemModel, delegate { throw new NotImplementedException("なにこれ"); // base._003Cuiamf_003E__2.ClearMessage(); // base._003CisItemGetWait_003E__5 = false; }); while (isShipWait || isItemGetWait) { yield return(null); } observer.OnNext(value: true); observer.OnCompleted(); }
private IEnumerator CreateTorpedoCutIn(UniRx.IObserver <bool> observer) { BattleCutInEffectCamera cam = BattleTaskManager.GetBattleCameras().cutInEffectCamera; UITexture centerLine = ((Component)cam.transform.FindChild("TorpedoLine/OverlayLine")).GetComponent <UITexture>(); if (centerLine != null) { centerLine.alpha = 0f; } _prodTorpedoCutIn = ProdTorpedoCutIn.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdTorpedoCutIn).GetComponent <ProdTorpedoCutIn>(), _clsRaigeki, cam.transform); BattleTaskManager.GetBattleCameras().enemyFieldCamera.cullingMask = BattleTaskManager.GetBattleCameras().GetDefaultLayers(); yield return(new WaitForEndOfFrame()); prefabProdTorpedoStraight = (UnityEngine.Object.Instantiate(BattleTaskManager.GetPrefabFile().prefabTorpedoStraightController, Vector3.zero, Quaternion.identity) as Transform); Transform transP4 = new GameObject().transform; transP4.name = "ProdTorpedoSalvoPhase2"; _prodTorpedoSalvoPhase2 = new ProdTorpedoSalvoPhase2(transP4, ((Component)prefabProdTorpedoStraight).GetComponent <TorpedoStraightController>()); _prodTorpedoSalvoPhase2.Initialize(_clsRaigeki, TorpedoParticle, centerLine); yield return(new WaitForEndOfFrame()); Transform transP3 = new GameObject().transform; transP3.name = "ProdTorpedoSalvoPhase3"; _prodTorpedoSalvoPhase3 = new ProdTorpedoSalvoPhase3(transP3); _prodTorpedoSalvoPhase3.Initialize(_clsRaigeki, TorpedoParticle); yield return(new WaitForEndOfFrame()); _prodTorpedoSalvoPhase3.SetHpGauge(); yield return(new WaitForEndOfFrame()); observer.OnNext(value: true); observer.OnCompleted(); }
protected virtual IEnumerator AnimationObserver(UniRx.IObserver <bool> observer) { yield return(new WaitForEndOfFrame()); observer.OnNext(value: true); observer.OnCompleted(); }
private IEnumerator SearchLight_FlareBullet_Coroutine(UniRx.IObserver <int> observer) { BattleFieldCamera camera = BattleTaskManager.GetBattleCameras().fieldCameras[0]; Vector3? searchPointOfGaze = GetSearchLightShipPointOfGaze(); if (searchPointOfGaze.HasValue) { _ctrlSearchLight.ReferenceCameraTransform = camera.transform; _ctrlSearchLight.SearchLightCameraStartPivot = camera.transform.position; _ctrlSearchLight.SearchLightPivot = searchPointOfGaze.Value; yield return(_ctrlSearchLight.PlayAnimation().StartAsCoroutine(delegate { }, delegate { })); } Vector3?flarePointOfGaze = GetFlareBulletShipPointOfGaze(); if (flarePointOfGaze.HasValue) { _ctrlFlareBullet.ReferenceCameraTransform = camera.transform; _ctrlFlareBullet.FlareBulletCameraStartPivot = camera.transform.position; _ctrlFlareBullet.FlareBulletFirePivot = flarePointOfGaze.Value; yield return(_ctrlFlareBullet.PlayAnimation().StartAsCoroutine(delegate { }, delegate { })); } observer.OnNext(0); observer.OnCompleted(); }
private IEnumerator AnimationCoroutine(UniRx.IObserver <int> observer) { if (_isAnimating) { observer.OnNext(0); observer.OnCompleted(); yield break; } _isAnimating = true; SetupFragment(); yield return(new WaitForSeconds(2f)); _isAnimating = false; observer.OnNext(0); observer.OnCompleted(); }
private IEnumerator Creator(string path, HttpMethod httpMethod, byte[] formData, UniRx.IObserver <string> observer, CancellationToken cancellationToken) { string url = $"{m_baseUrl}{path}"; switch (httpMethod) { case HttpMethod.PUT: using (UnityWebRequest www = UnityWebRequest.Put(url, formData)) { www.SendWebRequest(); while (!www.isDone && !cancellationToken.IsCancellationRequested) { yield return(null); } if (cancellationToken.IsCancellationRequested) { yield break; } if (www.isNetworkError || www.isHttpError) { observer.OnError(new Exception(www.error)); } else { observer.OnNext(www.downloadHandler.text); observer.OnCompleted(); } } break; default: break; } }
public object RxBuildRequest <T>(UniRx.IObserver <T> o, Converter.Converter convert, RestMethodInfo methodInfo, string url) { Action <HttpResponseMessage <string> > responseMessage = message => { string errorMessage = ""; if (IsRequestError(message, out errorMessage)) { o.OnError(new Exception(errorMessage)); return; } string result = GetSuccessResponse(message); // result = "[]"; // result = "[asd..s]"; if (EnableDebug) { Debug.LogFormat("Raw Response:{0}", result); } //Parse Json By Type if (typeof(T) == typeof(string)) { var resultData = (T)(object)result; o.OnNext(resultData); o.OnCompleted(); return; } T data = default(T); bool formatError = false; try { data = convert.FromBody <T>(result); } catch (ConversionException e) { formatError = true; o.OnError(new Exception(e.Message)); } if (!formatError) { o.OnNext(data); o.OnCompleted(); } }; HttpClientRequest httpClientRequest = new HttpClientRequest(new Uri(url), responseMessage); ConfigureRESTfulApi(methodInfo, httpClientRequest); return(httpClientRequest); }
public IEnumerator Hide(UniRx.IObserver <bool> observer) { _tra.LTScaleY(0f, 0.3f).setEase(LeanTweenType.easeOutCubic); yield return(new WaitForSeconds(0.3f)); observer.OnNext(value: true); observer.OnCompleted(); }
private IEnumerator AnimationObserver(UniRx.IObserver <bool> observer) { if (animation.isPlaying) { observer.OnNext(value: true); observer.OnCompleted(); yield break; } animation.Play(); throw new NotImplementedException("‚È‚É‚±‚ê"); //yield return Observable.Timer(TimeSpan.FromSeconds(animation.get_Item("ProdNightRadarDeployment").length)).StartAsCoroutine(); yield return(Observable.Timer(TimeSpan.FromSeconds(0)).StartAsCoroutine()); observer.OnNext(value: true); observer.OnCompleted(); }
private static IEnumerator SendRequestCoroutine(HttpMethod httpMethod, string url, string postData, Dictionary <string, string> headers, int timeout, UniRx.IObserver <string> observer, CancellationToken cancel) { UnityWebRequest webRequest = null; switch (httpMethod) { case HttpMethod.Get: webRequest = UnityWebRequest.Get(url); break; case HttpMethod.Post: webRequest = UnityWebRequest.Post(url, postData); break; case HttpMethod.Put: webRequest = UnityWebRequest.Put(url, postData); break; case HttpMethod.Delete: webRequest = UnityWebRequest.Delete(url); break; } webRequest.timeout = timeout; foreach (var header in headers) { webRequest.SetRequestHeader(header.Key, header.Value); } using (webRequest) { webRequest.SendWebRequest(); yield return(new WaitUntil(() => webRequest.isDone || webRequest.isHttpError || webRequest.isNetworkError || cancel.IsCancellationRequested)); if (cancel.IsCancellationRequested) { yield break; } if (webRequest.isHttpError || webRequest.isNetworkError) { observer.OnError(new WWWErrorException(webRequest, webRequest.error)); } else { var spliter = new string[] { "$!$" }; var package = webRequest.downloadHandler.text.Split(spliter, StringSplitOptions.RemoveEmptyEntries)[1]; observer.OnNext(package); observer.OnCompleted(); } } }
private IEnumerator InitBattle(UniRx.IObserver <float> observer) { observer.OnNext(0f); while (!_clsBattleShips.isInitialize) { yield return(null); } observer.OnNext(1f); observer.OnCompleted(); }
private IEnumerator RequesterArray <T>(string path, HttpMethod httpMethod, UniRx.IObserver <T[]> observer, CancellationToken cancellationToken) { string url = $"{m_baseUrl}{path}"; switch (httpMethod) { case HttpMethod.GET: using (UnityWebRequest www = UnityWebRequest.Get(url)) { www.SendWebRequest(); while (!www.isDone && !cancellationToken.IsCancellationRequested) { yield return(null); } if (cancellationToken.IsCancellationRequested) { yield break; } if (www.isNetworkError || www.isHttpError) { observer.OnError(new Exception(www.error)); } else { if (www.responseCode == 200) { observer.OnNext(JsonHelper.FromJsonArray <T>(www.downloadHandler.text)); observer.OnCompleted(); } else { observer.OnNext(default(T[])); observer.OnCompleted(); } } } break; default: break; } }
private IEnumerator CreateBCBattle(UniRx.IObserver <ProdBCBattle> observer) { if (_prodBCBattle == null) { _prodBCBattle = ProdBCBattle.Instantiate(((Component)BattleCutManager.GetPrefabFile().prefabProdBCBattle).GetComponent <ProdBCBattle>(), BattleCutManager.GetSharedPlase()); } yield return(null); observer.OnNext(_prodBCBattle); observer.OnCompleted(); }
protected override IEnumerator AnimationObserver(UniRx.IObserver <bool> observer) { base.animation.Play(AnimationList.ProdBufferTorpedoSalvo.ToString()); SoundUtils.PlaySE(SEFIleInfos.SE_926a); throw new NotImplementedException("‚È‚É‚±‚ê"); // yield return new WaitForSeconds(base.animation.get_Item(AnimationList.ProdBufferTorpedoSalvo.ToString()).length); yield return(new WaitForSeconds(0)); observer.OnNext(value: true); observer.OnCompleted(); }
private IEnumerator AnimationObserver(UniRx.IObserver <bool> observer) { if (animation.isPlaying) { observer.OnNext(value: true); observer.OnCompleted(); } panel.widgetsAreStatic = false; base.transform.localScaleOne(); animation.Play(((UnityEngine.Object)animation.clip).name); throw new NotImplementedException("‚È‚É‚±‚ê"); // yield return Observable.Timer(TimeSpan.FromSeconds(animation.get_Item(((UnityEngine.Object)animation.clip).name).length)).StartAsCoroutine(); yield return(Observable.Timer(TimeSpan.FromSeconds(0)).StartAsCoroutine()); observer.OnNext(value: true); observer.OnCompleted(); panel.widgetsAreStatic = true; }
public static IEnumerator Instantiate(UniRx.IObserver <BattleShutter> observer, BattleShutter prefab, Transform parent, int nPanelDepth) { BattleShutter obj = UnityEngine.Object.Instantiate(prefab); obj.transform.parent = parent; obj.transform.localScale = Vector3.one; obj.transform.localPosition = Vector3.zero; yield return(null); observer.OnNext(obj); observer.OnCompleted(); }
private IEnumerator CreateTorpedoPhase2(UniRx.IObserver <bool> observer) { Transform torpedoStraight = UnityEngine.Object.Instantiate(BattleTaskManager.GetPrefabFile().prefabTorpedoStraightController, Vector3.zero, Quaternion.identity) as Transform; Transform trams = new GameObject().transform; trams.name = "ProdTorpedoSalvoPhase2"; _prodTorpedoSalvoPhase2 = new ProdTorpedoSalvoPhase2(trams, ((Component)torpedoStraight).GetComponent <TorpedoStraightController>()); _prodTorpedoSalvoPhase2.Initialize(_clsRaigeki, TorpedoParticle, CenterLine); yield return(new WaitForEndOfFrame()); observer.OnNext(value: true); observer.OnCompleted(); }
static IEnumerator RunAsyncOperation(UnityEngine.AsyncOperation asyncOperation, UniRx.IObserver <float> observer, CancellationToken cancellationToken) { while (!asyncOperation.isDone && !cancellationToken.IsCancellationRequested) { observer.OnNext(asyncOperation.progress); yield return(null); } if (!cancellationToken.IsCancellationRequested) { observer.OnNext(asyncOperation.progress); // push 100% observer.OnCompleted(); } }
private IEnumerator AnimationObserver(UniRx.IObserver <bool> observer) { LeanTweenType iType = LeanTweenType.easeOutQuad; sprite.alpha = 0f; sprite.transform.localScaleZero(); yield return(new WaitForEndOfFrame()); float fAnimTime6 = 0.2f; base.transform.LTValue(sprite.alpha, 1f, fAnimTime6).setEase(iType).setOnUpdate(delegate(float x) { throw new NotImplementedException("なにこれ"); // this.sprite.alpha = x; }); base.transform.LTMoveLocalY(16f, fAnimTime6).setEase(iType); base.transform.LTScale(Vector3.one, fAnimTime6); yield return(Observable.Timer(TimeSpan.FromSeconds(fAnimTime6)).StartAsCoroutine()); fAnimTime6 = 0.2f; base.transform.LTMoveLocalY(0f, fAnimTime6); yield return(Observable.Timer(TimeSpan.FromSeconds(fAnimTime6)).StartAsCoroutine()); fAnimTime6 = 0.2f; base.transform.LTMoveLocalY(-7f, fAnimTime6); base.transform.LTScale(new Vector3(1.3f, 0.3f, 0f), fAnimTime6); yield return(Observable.Timer(TimeSpan.FromSeconds(fAnimTime6)).StartAsCoroutine()); fAnimTime6 = 0.2f; base.transform.LTMoveLocalY(6f, fAnimTime6); base.transform.LTScale(Vector3.one, fAnimTime6); yield return(Observable.Timer(TimeSpan.FromSeconds(fAnimTime6)).StartAsCoroutine()); fAnimTime6 = 0.2f; base.transform.LTMoveLocalY(0f, fAnimTime6); base.transform.LTScale(Vector3.one, fAnimTime6); yield return(Observable.Timer(TimeSpan.FromSeconds(fAnimTime6)).StartAsCoroutine()); fAnimTime6 = 0.1f; base.transform.LTValue(sprite.alpha, 0f, fAnimTime6).setEase(iType).setOnUpdate(delegate(float x) { throw new NotImplementedException("なにこれ"); // this.sprite.alpha = x; }); base.transform.LTMoveLocalY(0f, fAnimTime6); base.transform.LTScale(Vector3.one, fAnimTime6); yield return(Observable.Timer(TimeSpan.FromSeconds(fAnimTime6)).StartAsCoroutine()); observer.OnNext(value: true); observer.OnCompleted(); }
private IEnumerator AnimationCoroutine(UniRx.IObserver <int> observer) { if (_isAnimating) { observer.OnNext(0); observer.OnCompleted(); yield break; } _isAnimating = true; _anim.isEval = true; _animationBegan = Time.time; _animation.Play(AnimationClipName); throw new NotImplementedException("‚È‚É‚±‚ê"); //yield return new WaitForSeconds(_animation.get_Item(AnimationClipName).length); yield return(new WaitForSeconds(0)); _anim.isEval = false; _isAnimating = false; observer.OnNext(0); observer.OnCompleted(); }
private IEnumerator AnimationCoroutine(UniRx.IObserver <int> observer) { if (_isAnimating) { observer.OnNext(0); observer.OnCompleted(); yield break; } _isAnimating = true; Mode mode = _mode; Transform flat = (mode != 0) ? _heavyFlat : _moderateFlat; ExplodeChild explode = (mode != 0) ? _heavy : _moderate; flat.localScale = Vector3.one * _defaultScale; string animationClip = (mode != 0) ? "ModerateOrHeavy_Heavy" : "ModerateOrHeavy"; _animation.Play(animationClip); var clip = _animation.GetClip(animationClip); clip.SampleAnimation(base.gameObject, 0f); throw new NotImplementedException("なにこれ"); //yield return new WaitForSeconds(_animation.get_Item(animationClip).length); yield return(new WaitForSeconds(0)); flat.localScale = Vector3.zero; explode.transform.localScale = Vector3.one * _defaultScale; yield return(explode.PlayAnimation().StartAsCoroutine()); explode.transform.localScale = Vector3.zero; explode.ResetFragment(); _isAnimating = false; observer.OnNext(0); observer.OnCompleted(); }
private IEnumerator PlayMovie(UniRx.IObserver <bool> observer) { int retryCnt = 0; while (true) { throw new NotImplementedException("なにこれ"); //if (PSVitaVideoPlayer.Play(moviePath, _iLooping, _iMode)) if (true) { observer.OnNext(value: true); observer.OnCompleted(); yield break; } if (retryCnt >= 3) { break; } retryCnt++; yield return(null); } observer.OnNext(value: false); observer.OnCompleted(); }
private IEnumerator CreateTorpedoPhase3(UniRx.IObserver <bool> observer) { Transform trams = new GameObject().transform; trams.name = "ProdTorpedoSalvoPhase3"; _prodTorpedoSalvoPhase3 = new ProdTorpedoSalvoPhase3(trams); _prodTorpedoSalvoPhase3.Initialize(_clsRaigeki, TorpedoParticle); yield return(new WaitForEndOfFrame()); _prodTorpedoSalvoPhase3.SetHpGauge(); yield return(new WaitForEndOfFrame()); observer.OnNext(value: true); observer.OnCompleted(); }
private IEnumerator _createTorpedoWake(UniRx.IObserver <bool> observer) { Dictionary <int, UIBattleShip> _dicFriendShips = BattleTaskManager.GetBattleShips().dicFriendBattleShips; Dictionary <int, UIBattleShip> _dicEnemyShips = BattleTaskManager.GetBattleShips().dicEnemyBattleShips; _listTorpedoWake = new List <PSTorpedoWake>(); _createTorpedo(FleetType.Friend, _dicFriendShips, _dicEnemyShips); yield return(new WaitForEndOfFrame()); _createTorpedo(FleetType.Enemy, _dicEnemyShips, _dicFriendShips); yield return(new WaitForEndOfFrame()); observer.OnNext(value: true); observer.OnCompleted(); }