private IEnumerator EndTeleport() { // 이펙트 for (int i = 0; i < _EndSprites.Length; ++i) { _SpriteRenderer.sprite = _EndSprites[i]; yield return(YieldInstructionCache.WaitForSeconds(0.01f)); if (i == 6) { _player.transform.localScale = Vector3.one; _weapon.transform.localScale = Vector3.one; // 플레이어 이동 _player.transform.position = this.transform.position; _weapon.transform.position = this.transform.position; } } // 위치 고정 해제 _playerController.CanMove = true; _SpriteRenderer.sprite = null; _isTeleport = false; this.gameObject.SetActive(false); }
private IEnumerator DurationSlowing() { yield return(YieldInstructionCache.WaitForSeconds(5.0f)); SkillPoolManager.Instance.RechargeSkill(this.gameObject, this.transform.parent); StopCoroutine(DurationSlowing()); }
protected override IEnumerator SlidingCoroutine() { canSlide = true; int type = (int)ControlTypeAbnormalStatus.SLIDING; abnormalComponents.SlidingEffect.SetActive(true); AddRetrictsMovingCount(); AddRetrictsBehaviorCount(); //animationHandler.Idle(); isControlTypeAbnormalStatuses[type] = true; Vector2 dirVector = controller.GetMoveRecentNormalInputVector(); Debug.Log("sliding 코루틴 시작, " + dirVector); while (CharacterInfo.AbnormalImmune.SLIDING != (abnormalImmune & CharacterInfo.AbnormalImmune.SLIDING)) { if (IsMine()) { // TODO : Modify Sliding animation components.AnimHandler.Walk(); bodyTransform.Translate(dirVector * movingSpeed * Time.fixedDeltaTime); } if (false == canSlide) { components.AnimHandler.Idle(); Debug.Log("sliding 코루틴 종료"); break; } yield return(YieldInstructionCache.WaitForSeconds(Time.fixedDeltaTime)); } StopControlTypeAbnormalStatus(ControlTypeAbnormalStatus.SLIDING); }
private IEnumerator HitDetermination() { Color color = _SpriteRenderer.color; _isAttackPossible = false; _HighLight.SetActive(true); _damegedEffect.SetActive(true); color.a = 0.5f; _SpriteRenderer.color = color; yield return(YieldInstructionCache.WaitForSeconds(0.25f)); _HighLight.SetActive(false); color.a = 1.0f; _SpriteRenderer.color = color; yield return(YieldInstructionCache.WaitForSeconds(0.25f)); color.a = 0.5f; _SpriteRenderer.color = color; yield return(YieldInstructionCache.WaitForSeconds(0.25f)); color.a = 1.0f; _SpriteRenderer.color = color; yield return(YieldInstructionCache.WaitForSeconds(0.25f)); color.a = 0.5f; _SpriteRenderer.color = color; yield return(YieldInstructionCache.WaitForSeconds(0.25f)); color.a = 1.0f; _SpriteRenderer.color = color; _damegedEffect.SetActive(false); _isAttackPossible = true; }
public IEnumerator EndGame() { yield return(YieldInstructionCache.WaitForSeconds(2.0f)); StartCoroutine(_uiManager.Fade(true)); _player.SetActive(false); }
private IEnumerator StartTeleport() { // 로케이션 이동 this.transform.position = OperationData.Player.position; _direation = Utility.LookAt(MainCamController.MousePosition, OperationData.Player.position); _direation = new Vector3(_direation.x, _direation.y, 0); // 위치 고정 _player.GetComponentInChildren <PlayerController>().CanMove = false; // 이펙트 for (int i = 0; i < _StartSprites.Length; ++i) { _SpriteRenderer.sprite = _StartSprites[i]; yield return(YieldInstructionCache.WaitForSeconds(0.01f)); if (i == 6) { _player.transform.localScale = Vector3.zero; _weapon.transform.localScale = new Vector3(1.0f, 0.0f, 1.0f); } } _SpriteRenderer.sprite = null; // 발사 _rb.isKinematic = true; _rb.isKinematic = false; _rb.AddForce(_direation * 50000.0f); yield return(YieldInstructionCache.WaitForSeconds(0.025f)); SetPosition(); }
private IEnumerator DisalbeEffect() { yield return(YieldInstructionCache.WaitForSeconds( _Animator.GetCurrentAnimatorStateInfo(0).length)); this.transform.parent = _Bullet; this.transform.position = _Bullet.position; this.gameObject.SetActive(false); }
private IEnumerator DelaySpit() { yield return(YieldInstructionCache.WaitForSeconds(1.0f)); _isSpit = true; yield return(YieldInstructionCache.WaitForSeconds(0.9f)); _condition.SetCondition(Condition.kIdle); }
private IEnumerator Cooldown() { float coolDown = 0.0f; while (true) { coolDown = _playerStats == null ? 1.0f : _playerStats.ShootSpeed; yield return(YieldInstructionCache.WaitForSeconds(coolDown)); _isAttack = true; } }
public IEnumerator LightOn() { for (int i = 0; i < lights.Count; ++i) { for (int j = 0; j < lights[i].lightArray.Length; ++j) { lights[i].lightArray[j].enabled = true; } yield return(YieldInstructionCache.WaitForSeconds(delay)); } }
IEnumerator DeadDuration(float time) { yield return(YieldInstructionCache.WaitForSeconds(time)); SpriteRenderer spr = this.GetComponent <SpriteRenderer>(); for (int i = 10; i > 0; --i) { spr.color = new Color(spr.color.r, spr.color.g, spr.color.b, i * 0.1f); yield return(YieldInstructionCache.WaitForSeconds(0.1f)); } Destroy(this.transform.parent.gameObject); }
public IEnumerator MakeQuestion(int missingCount) { solarSystem.MoveStartPoint(true); yield return(YieldInstructionCache.WaitForSeconds(0.5f)); for (int i = 0; i < missingCount; ++i) { MissingPlanet(); } yield return(StartCoroutine(solarSystem.MoveArrivePoint(true))); }
private IEnumerator Send(TextMesh tm) { this.GetComponent <Rigidbody>().AddForce(Vector3.up * 10.0f); yield return(YieldInstructionCache.WaitForSeconds(0.5f)); for (int i = 10; i >= 0; --i) { tm.color = new Color(tm.color.r, tm.color.g, tm.color.b, i * 0.1f); yield return(YieldInstructionCache.WaitForSeconds(0.1f)); } MessagePoolManager.Instance.Reload(this.gameObject); }
protected IEnumerator CheckKnockbackEnded() { while (true) { yield return(YieldInstructionCache.WaitForSeconds(Time.fixedDeltaTime)); if (rgbody.velocity.magnitude < 0.2f) { SubRetrictsMovingCount(); checkingknockBackEnded = null; break; } } }
private IEnumerator DoBlink() { int blinkCount = Random.Range(minBlinkCount, maxBlinkCount + 1); for (int i = 0; i < blinkCount; ++i) { flashLight.enabled = false; yield return(YieldInstructionCache.WaitForSeconds(delayTime)); flashLight.enabled = true; yield return(YieldInstructionCache.WaitForSeconds(delayTime)); } }
private IEnumerator DoThunder() { thunderLight.enabled = true; yield return(YieldInstructionCache.WaitForSeconds(delayTime)); thunderLight.enabled = false; yield return(YieldInstructionCache.WaitForSeconds(delayTime)); thunderLight.enabled = true; yield return(YieldInstructionCache.WaitForSeconds(delayTime)); thunderLight.enabled = false; }
private IEnumerator FireBullet(int idx, Transform monster) { yield return(YieldInstructionCache.WaitForSeconds(0.5f)); for (int i = 0; i < idx; i++) { GameObject obj = this.transform.GetChild(i).gameObject; obj.transform.position = monster.GetChild(2).transform.position; obj.SetActive(true); obj.GetComponent <Rigidbody>().AddForce(new Vector3(100f * _monsterstats.BulletSpeed * Mathf.Cos(Mathf.PI * 2 * i / _bulletNum), 100f * _monsterstats.BulletSpeed * Mathf.Sin(Mathf.PI * i * 2 / _bulletNum)), 0); obj.transform.Rotate(new Vector3(0f, 0f, 360 * i / _bulletNum - 90)); } }
private IEnumerator SlowPlayer(PlayerController _player) { int i = 0; while (true) { // 플레이어를 슬로우시킨다 yield return(YieldInstructionCache.WaitForSeconds(1.0f)); i++; if (i > 3) { StopCoroutine(SlowPlayer(_player)); } } }
private IEnumerator Animate(Transform target) { MouseCursor.Instance.Set(CursorIcon.kBasic); // 초기화 및 위치 조절 this.transform.position = new Vector3( target.transform.position.x, target.transform.position.y, ObjectSortLevel.kUI); this.transform.localScale = target.transform.localScale * 2.0f; Room room = target.parent.parent.GetComponent <Room>(); SpriteRenderer sr = this.GetComponent <SpriteRenderer>(); // 애니메이션 재생 for (int i = 0; i < _CaptureEffectSprites.Length; ++i) { sr.sprite = _CaptureEffectSprites[i]; yield return(YieldInstructionCache.WaitForSeconds(0.05f)); } // 몬스터 감추기 SpriteRenderer[] srs = target.GetComponentsInChildren <SpriteRenderer>(); for (int i = 10; i >= 0; --i) { for (int j = 0; j < srs.Length; ++j) { srs[j].color = new Color(srs[j].color.r, srs[j].color.g, srs[j].color.b, i * 0.1f); } yield return(YieldInstructionCache.WaitForSeconds(0.025f)); } target.gameObject.SetActive(false); for (int j = 0; j < srs.Length; ++j) { srs[j].color = Color.white; } for (int i = _CaptureEffectSprites.Length - 1; i >= 0; --i) { sr.sprite = _CaptureEffectSprites[i]; yield return(YieldInstructionCache.WaitForSeconds(0.05f)); } // 방에 몬스터 줄었다고 안내 room.SubtractionMonsterNumber(); // 인벤토리 추가 target.GetComponentInChildren <Monster>().Index.Set(-1, -1); MonsterInventory.Instance.Add(target.gameObject); Destroy(this.gameObject); }
/// <summary> /// 화면 퇴장 연출이 종료됐는지 확인합니다. /// </summary> /// <returns></returns> private System.Collections.IEnumerator WaitTweenComplete(float duration, bool leave) { if (duration > 0f) { yield return(YieldInstructionCache.WaitForSeconds(duration)); } if (leave) { OnPreChange(); } else { OnPostChange(); } yield break; }
protected IEnumerator CheckDashEnded(float distance) { float dashDistanceTotal = 0; while (true) { //Debug.Log(rgbody.velocity + " | " + rgbody.velocity.magnitude + " | " + dashDistanceTotal); yield return(YieldInstructionCache.WaitForSeconds(Time.fixedDeltaTime)); dashDistanceTotal += rgbody.velocity.magnitude; if (rgbody.velocity.magnitude < 1f || dashDistanceTotal >= distance) { rgbody.velocity = Vector2.zero; StopBehavior(BehaviorState.DASH); break; } } }
private IEnumerator SetDefenseUI() { // Placement UI 닫기 PlacementTrapToolTip.Instance.OffToolTip(); PlacementMonsterToolTip.Instance.OffToolTip(); _placement.Find("List").GetComponent <PlacementCursor>().ClearTarget(); _PlacementMap.SetActive(false); // FadeIn StartCoroutine(Fade(true)); yield return(YieldInstructionCache.WaitForSeconds(2.0f)); // CutScene float cutDelay = PlayCutScene(GameMode.DEFENSE); // 미리 배치해야 될 것들 yield return(YieldInstructionCache.WaitForSeconds(cutDelay + 0.5f)); _cutScene.gameObject.SetActive(false); _PlacementMap.GetComponent <PlacementUI>().Reset(); _placement.gameObject.SetActive(false); // FadeOut StartCoroutine(Fade(false)); // 입구 비추기 MainCamController mcc = Camera.main.GetComponent <MainCamController>(); Vector3 entrancePos = GameObject.FindGameObjectWithTag("Entrance").transform.position; mcc.transform.position = new Vector3(entrancePos.x, entrancePos.y, -100.0f); //===================================== // 용사 쳐들어오는 거 보여주기 yield return(YieldInstructionCache.WaitForSeconds(5.0f)); //===================================== // 카메라 돌리기 mcc.transform.position = OperationData.MapData[mcc.Index.x, mcc.Index.y].Find("Monsters").position; StartCoroutine(Fade(true)); yield return(YieldInstructionCache.WaitForSeconds(2.0f)); // 배치 코딩 할 곳 _DefenseMap.SetActive(true); StartCoroutine(Fade(false)); yield return(YieldInstructionCache.WaitForSeconds(2.0f)); }
private IEnumerator DamegedEffect() { UnityEngine.UI.Image image = _damegedEffect.GetComponent <UnityEngine.UI.Image>(); Color color = image.color; _damegedEffect.SetActive(true); for (int i = 0; i < 5; ++i) { color.a = i * 0.2f; image.color = color; yield return(YieldInstructionCache.WaitForSeconds(0.1f)); } for (int i = 5; i > -1; --i) { color.a = i * 0.2f; image.color = color; yield return(YieldInstructionCache.WaitForSeconds(0.1f)); } }
IEnumerator DeadDuration(float time) { if (Random.Range(0, 100) % 100 == 0) //100분의 1로 마석 드랍 { DropStone(); } else if (Random.Range(0, 2) == 1) //그게아니면 2분의 1로 골드드랍 { DropGold(); } yield return(YieldInstructionCache.WaitForSeconds(time)); SpriteRenderer spr = this.GetComponent <SpriteRenderer>(); for (int i = 10; i > 0; --i) { spr.color = new Color(spr.color.r, spr.color.g, spr.color.b, i * 0.1f); yield return(YieldInstructionCache.WaitForSeconds(0.1f)); } Destroy(this.transform.parent.gameObject); }
public IEnumerator Fade(bool isIn) { RawImage image = _BasicCanvas.transform.Find("Fade").GetComponent <RawImage>(); if (isIn) { // FadeIn for (int i = 1; i <= 10; ++i) { image.color = new Color(0.0f, 0.0f, 0.0f, i * 0.1f); yield return(YieldInstructionCache.WaitForSeconds(0.1f)); } } else { for (int i = 10; i >= 0; --i) { image.color = new Color(0.0f, 0.0f, 0.0f, i * 0.1f); yield return(YieldInstructionCache.WaitForSeconds(0.1f)); } } }
private IEnumerator SetShopUI() { // 인벤토리 닫기 IsInventory = false; _SpellBook.SetActive(false); _NecronomiconBook.SetActive(false); // 마우스 변경 MouseCursor.Instance.Set(CursorIcon.kBasic); // FadeIn StartCoroutine(Fade(true)); yield return(YieldInstructionCache.WaitForSeconds(2.0f)); // CutScene float cutDelay = PlayCutScene(GameMode.SHOP); // 미리 배치해야 될 것들 yield return(YieldInstructionCache.WaitForSeconds(cutDelay + 0.5f)); _cutScene.gameObject.SetActive(false); OperationData.Player.GetComponentInChildren <PlayerController>().Placement(); OperationData.Weapons.gameObject.SetActive(false); // 로그라이크 UI 끄기 _BasicCanvas.transform.Find("RogueLike").gameObject.SetActive(false); // 상점 UI 켜기 _shop.gameObject.SetActive(true); // 랜덤 상인 활성화 int r = Random.Range(0, _shop.childCount); _shop.GetChild(r).gameObject.SetActive(true); _shop.GetChild(r).GetComponent <IShop>().OpenShop(); // FadeOut StartCoroutine(Fade(false)); yield return(YieldInstructionCache.WaitForSeconds(2.0f)); }
protected override IEnumerator StunCoroutine(float effectiveTime) { int type = (int)ControlTypeAbnormalStatus.STUN; abnormalComponents.StunEffect.SetActive(true); AddRetrictsMovingCount(); AddRetrictsBehaviorCount(); components.AnimHandler.Idle(); //animationHandler.Idle(); isControlTypeAbnormalStatuses[type] = true; controlTypeAbnormalStatusTime[type] = 0; controlTypeAbnormalStatusesDurationMax[type] = effectiveTime; while (controlTypeAbnormalStatusTime[type] <= controlTypeAbnormalStatusesDurationMax[type]) { if (CharacterInfo.AbnormalImmune.STUN == (abnormalImmune & CharacterInfo.AbnormalImmune.STUN)) { controlTypeAbnormalStatusesDurationMax[type] = 0; break; } controlTypeAbnormalStatusTime[type] += Time.fixedDeltaTime; yield return(YieldInstructionCache.WaitForSeconds(Time.fixedDeltaTime)); } StopControlTypeAbnormalStatus(ControlTypeAbnormalStatus.STUN); }
private IEnumerator SetPlacementUI() { // 인벤토리 닫기 IsInventory = false; _SpellBook.SetActive(false); _NecronomiconBook.SetActive(false); // FadeIn StartCoroutine(Fade(true)); yield return(YieldInstructionCache.WaitForSeconds(2.0f)); // CutScene float cutDelay = PlayCutScene(GameMode.PLACEMENT); // 미리 배치해야 될 것들 yield return(YieldInstructionCache.WaitForSeconds(cutDelay + 0.5f)); _cutScene.gameObject.SetActive(false); _shop.gameObject.SetActive(false); Room room = _dungeonMap[_playerController.Index.x, _playerController.Index.y].GetComponent <Room>(); room._MonsterNum = room.MaximumMonsterNum; UpdatePopulation(room._MonsterNum, room.MaximumMonsterNum); // 배치 코딩 할 곳 _BasicCanvas.transform.Find("Common").gameObject.SetActive(false); _PlacementMap.SetActive(true); _placement.gameObject.SetActive(true); _placement.Find("Timer").GetComponent <PlacementTimer>().StartCoroutine("StartTimer"); // FadeOut StartCoroutine(Fade(false)); yield return(YieldInstructionCache.WaitForSeconds(2.0f)); }
public static IEnumerator WaitForTime(float time, Action onComplete) { yield return(YieldInstructionCache.WaitForSeconds(time)); onComplete?.Invoke(); }
public override IEnumerator Run(MonoBehaviour runner, TestEntity origin, TestEntity destination) { yield return(YieldInstructionCache.WaitForSeconds(PATTERN_DELAY)); }