/// <summary> /// 유저가 일정된 시간 동안 탑승을 하지 않았을 경우 진행을 위해서 오브젝트를 강제로 움직인다. /// 주로 호버보드 탑승의 경우에 유저가 타지 못해서 진행이 안 될 경우를 위해서 가동시킨다. /// 먼저 유저가 타서 작동되면 코루틴은 꺼지게 되어있다. /// </summary> /// <param name="time"></param> /// <param name="bothMember"></param> /// <param name="direction"></param> /// <returns></returns> public IEnumerator <CoroutinePhase> Emergency(float time, bool bothMember, Direction direction = null) { yield return(Suspend.Do(time)); if (GameData.Instance.UseNetwork) { if (!bothMember) { direction.SendDirectionHoverActive(); } else { DirectionManager.Instance.ActiveBothMember(); } } else if (!GameData.Instance.UseNetwork) { if (!bothMember) { direction.DirectionActive(); } else { DirectionManager.Instance.ActiveBothMember(); } } }
protected IEnumerator <CoroutinePhase> DirectionRestore(float time, Direction m_direction) { yield return(Suspend.Do(time)); m_direction.Restore(); CoroutineManager.Instance.Unregister(m_coroutine); }
private IEnumerator <CoroutinePhase> ActiveOrder() { DirectionManager.Instance.OpenNarration(4009); m_direction.SetParentInit(); m_ceilingObject.SetActive(true); AssetManager.Effect.Retrieve("DirectionSound_HoverShield", m_ceilingObject.transform); yield return(Suspend.Do(m_activeTime)); AssetManager.Effect.Retrieve("DirectionSound_HoverAccel", transform); GameData.Instance.Map.Move(1); }
//PJY 17.01.17 생성후 1초뒤 UI Open public IEnumerator <CoroutinePhase> Delay() { if (this.GetComponent <Character>() != null && this.GetComponent <Character>().IsAlive()) { hpBar.SetActive(true); } yield return(Suspend.Do(3.0f)); hpBar.SetActive(false); }
private IEnumerator <CoroutinePhase> RockMoveSegTwo() { int rockCount = 0; Quaternion rot = transform.localRotation; yield return(Suspend.Do(5f)); loopSound = AssetManager.Effect.Retrieve("DirectionSound_PortalLoop", transform); pathnum = 11; while (rockCount < 65) { yield return(Suspend.Do(1f)); //pathnum = Random.Range(11, 36); switch (rockCount) { case 2: DirectionManager.Instance.OpenNarration(5002); break; case 3: AssetManager.Effect.Retrieve("Direction_ceiling_sound", GameData.Instance.HoverCraftSegTwo.transform); break; case 4: GameData.Instance.HoverCraftSegTwo.MakeCeiling(); break; } AssetManager.Direction.Retrieve(rock, m_transformPos, rot, m_custompath[pathnum]); ++rockCount; ++pathnum; } ///아래부터 포탈이 닫힐때/// yield return(Suspend.Do(2f)); openPotal.SetActive(false); closePotal.SetActive(true); if (loopSound != null) { loopSound.Restore(); } yield return(Suspend.Do(5f)); Restore(); }
//공격 받았을때 hp가 3초간 보이고 사라집니다. private IEnumerator <CoroutinePhase> BossDelay() { m_bossHpBar[m_bossTargetpart].Visable(); yield return(Suspend.Do(3.0f)); m_bossHpBar[m_bossTargetpart].Invisible(); if (m_bossdelaycorutineCommand != null) { CoroutineManager.Instance.Unregister(m_bossdelaycorutineCommand); m_bossdelaycorutineCommand = null; } }
IEnumerator <CoroutinePhase> Coroutine(float time) { yield return(Suspend.Do(time)); Transform _childTrans = transform.GetComponentInChildren <Animator>().transform; while (true) { Vector3 _pos = _childTrans.position; _pos.y += 0.3f; m_uiweaponPack.PosUpdate(_pos); yield return(null); } }
private IEnumerator <CoroutinePhase> Appear() { m_animator.SetBool("Active", true); m_direction.Finish = false; m_movecoroutine = CoroutineManager.Instance.Register(m_direction.m_custompath[0].PutOnPath(transform, m_direction.m_custompath[0], false)); while (!m_direction.Finish) { yield return(null); } m_direction.Finish = false; m_movecoroutine = CoroutineManager.Instance.Register(m_direction.m_custompath[1].PutOnPath(transform, m_direction.m_custompath[1], false)); for (int i = 0; i < m_turbinePos.Length; ++i) { AssetManager.Effect.Retrieve("FX_BoardLanding", m_turbinePos[i]); } yield return(Suspend.Do(1.0f)); AssetManager.Effect.Retrieve("DirectionSound_Hoverlanding", transform); while (!m_direction.Finish) { yield return(null); } _ride = UIManager.Instance.Open("UIRide", true) as UIRide; Vector3 _vec = transform.position; _vec.y += 1f; _ride.transform.position = _vec; if ("hoverboardSeg2_1" == gameObject.name) { if (UserType.Host == GameData.Instance.UserType) { m_emergency = CoroutineManager.Instance.Register(m_direction.Emergency(m_emergencyTime, true)); } } for (int i = 0; i < m_direction.m_directionCountCheck.Length; ++i) { m_direction.m_directionCountCheck[i].gameObject.SetActive(true); } }
private IEnumerator <CoroutinePhase> DeadTimer() { const float WAITTIME = 3f; yield return(Suspend.Do(WAITTIME)); if (GetComponent <DissolveShader>() != null) { DissolveShader shader = GetComponent <DissolveShader>(); shader.Process(); } yield return(Suspend.Do(WAITTIME)); Character.Restore(); }
private IEnumerator <CoroutinePhase> RockMove() { yield return(Suspend.Do(6f)); AssetManager.Direction.Retrieve("Armageddon", m_transformPos, m_custompath[pathnum]); loopSound = AssetManager.Effect.Retrieve("DirectionSound_PortalLoop", transform); yield return(Suspend.Do(10f)); while (true) { yield return(Suspend.Do(3f)); ++pathnum; AssetManager.Direction.Retrieve(rock, m_transformPos, m_custompath[pathnum]); } }
private IEnumerator <CoroutinePhase> ItemSetActive(float time, Action beforeAction = null, Action afterAction = null) { yield return(Suspend.Do(time)); if (null != beforeAction) { beforeAction(); } gameObject.SetActive(true); if (null != afterAction) { afterAction(); } CoroutineManager.Instance.Unregister(m_coroutine); }
private IEnumerator <CoroutinePhase> TimeAttack() { m_move = true; yield return(Suspend.Do(m_attacktime)); attackEmptyNum = UnityEngine.Random.Range(0, Skillset.Count); SkillStartPos = this.transform.position; SkillStartPos.y = 0; SkillStartPos.z = 0; m_weapon[0].position = SkillStartPos; AssetManager.Projectile.Retrieve(Skillset[attackEmptyNum], m_weapon[0], this.gameObject); Skillset.RemoveAt(attackEmptyNum); Attack(); }
private IEnumerator <CoroutinePhase> TimeAttack() { m_attackCycle++; yield return(Suspend.Do(skills[0].Cooltime())); if (null != CurrentTarget) { if (!skills[0].IsCooltime()) { if (AILogic.TargetDistance(this.transform, CurrentTarget) <= skills[0].SkillRange) { if (skills[0] != null) { //Debug.Log("공격"); WeaponPosition.transform.forward = (CurrentTarget.position - WeaponPosition.transform.position).normalized; AssetManager.Projectile.Retrieve(skills[0].SkillName, this.WeaponPosition, this.gameObject); skills[0].Reset(this); } } } } if (null != m_customPath) { if (m_attackCycle > m_customPath.m_nodes[m_customIndex].AttackCycle) { Move(); } else { Attack(); } } else { Attack(); } }
//공격 할 수 있는 타겟이 순차적으로 깜박입니다. 타겟이 공격받을 경우에만 데미지가 들어옵니다. private IEnumerator <CoroutinePhase> BosstargetFlicker() { float time = 0.0f; while (m_first) { if (istarget) { if (isactiveskill) { Character.AnimatorAction.Initialize <AnimatorActionBossAdd>(); isactiveskill = false; } m_first = false; break; } yield return(Suspend.OneFrame()); } while (true) { time += Time.deltaTime; m_bossTarget.VisibleObj(m_bossTargetpart); m_bossTarget.InVisibleColider(m_bossTargetpart); m_bossTarget.VisibleMesh(m_bossTargetpart); yield return(Suspend.Do(0.2f)); if (-1 == m_bossTargetpart || m_bossHpBar[m_bossTargetpart].Close()) { time = 0.0f; break; } m_bossTarget.InVisibleMesh(m_bossTargetpart); yield return(Suspend.Do(0.2f)); if (-1 == m_bossTargetpart || m_bossHpBar[m_bossTargetpart].Close()) { time = 0.0f; break; } if (time > m_flicktime) { m_bossTarget.InVisibleObj(m_bossTargetpart); m_bossHpBar[m_bossTargetpart].Invisible(); m_bossTarget.VisibleColider(m_bossTargetpart); time = 0.0f; m_bossTargetpart = HpCheck(m_bossTargetpart); if (-1 == m_bossTargetpart) { break; } } yield return(Suspend.OneFrame()); } }
private IEnumerator <CoroutinePhase> RestorTime(float time) { yield return(Suspend.Do(time)); base.Restore(); }
private IEnumerator <CoroutinePhase> Emergency() { yield return(Suspend.Do(m_emergencyTime)); m_direction.SendDirectionHoverActive(); }
private IEnumerator <CoroutinePhase> Appear() { m_direction.Finish = false; m_movecoroutine = CoroutineManager.Instance.Register(m_direction.m_custompath[0].PutOnPath(transform, m_direction.m_custompath[0], false)); while (!m_direction.Finish) { yield return(null); } CoroutineManager.Instance.Unregister(m_movecoroutine); m_movecoroutine = null; /////////////////////////////////////위까지 호버 첫번째 패스///////////////////////////////////////////////////////////// for (int i = 0; i < landingEffectPos.Length; ++i) { AssetManager.Effect.Retrieve("FX_BoardLanding", landingEffectPos[i]); //터빈에서 나올 화염이펙트 } switch (hovertype) { case HoverEnum.hoverBoard1: AssetManager.Effect.Retrieve("FX_BoardLandingDust", GameData.Instance.hoverLandingPos[0]); break; case HoverEnum.hoverBoard2: AssetManager.Effect.Retrieve("FX_BoardLandingDust", GameData.Instance.hoverLandingPos[1]); break; } yield return(Suspend.Do(0.5f)); /////////////////////////////////////위까지 하강연출///////////////////////////////////////////////////////////////////////////////////////////// m_direction.Finish = false; m_movecoroutine = CoroutineManager.Instance.Register(m_direction.m_custompath[1].PutOnPath(transform, m_direction.m_custompath[1], false)); yield return(Suspend.Do(4.2f)); AssetManager.Effect.Retrieve("DirectionSound_Hoverlanding", transform); while (!m_direction.Finish) { yield return(null); } CoroutineManager.Instance.Unregister(m_movecoroutine); m_movecoroutine = null; ////////////////////////////////////위까지 마지막 등장path/////////////////////////////////////////////////////////////////////////////////////////////////////////// m_animator.SetBool("Active", false); _ride = UIManager.Instance.Open("UIRide", true) as UIRide; Vector3 _vec = transform.position; _vec.y += 1f; _ride.transform.position = _vec; if (gameObject.name == "hoverboardSeg1_1") { DirectionManager.Instance.OpenNarration(4011); if (UserType.Host == GameData.Instance.UserType) { m_emergency = CoroutineManager.Instance.Register(m_direction.Emergency(m_emergencyTime, true)); } } for (int i = 0; i < m_direction.m_directionCountCheck.Length; ++i) { m_direction.m_directionCountCheck[i].gameObject.SetActive(true); } GetComponent <AudioSource>().volume = 0.0f; }