public override void Active() { if (m_direction.Active) { return; } m_direction.Active = true; if (UserType.Host == GameData.Instance.UserType) { //if (null != m_emergency) //{ // CoroutineManager.Instance.Unregister(m_emergency); //} if (null != m_hostcheck) { CoroutineManager.Instance.Unregister(m_hostcheck); } } if (null != m_order) { CoroutineManager.Instance.Unregister(m_order); m_order = null; } m_order = CoroutineManager.Instance.Register(ActiveOrder()); }
protected override void Directingsetting() { pathnum = 0; openPotal.SetActive(true); closePotal.SetActive(false); AssetManager.Effect.Retrieve("DirectionSound_PotalOpen", gameObject.transform); if (SceneManager.GetActiveScene().name == GameData.Instance.Segment02) { m_potalType = RockType.Seg2; potalFX.SetActive(false); transform.localScale = new Vector3(5f, 5f, 5f); } else { m_potalType = RockType.Seg1; } switch (m_potalType) { case RockType.Seg1: m_coroutine = CoroutineManager.Instance.Register(RockMove()); break; case RockType.Seg2: m_coroutine = CoroutineManager.Instance.Register(RockMoveSegTwo()); break; } }
protected override void Directingsetting() { //Effect soundEffect = AssetManager.Effect.Retrieve("DirectionSound_Rockfall", gameObject.transform); if (SceneManager.GetActiveScene().name == GameData.Instance.Segment01 && RockType.Rock == m_rockType) { gameObject.GetComponent <AudioSource>().enabled = false; } if (SceneManager.GetActiveScene().name == GameData.Instance.Segment02) { transform.rotation = rot; gameObject.GetComponent <AudioSource>().pitch = Random.Range(0.7f, 1.3f); StartCoroutine(SegTwo()); return; } if (RockType.Armageddon == m_rockType) { transform.eulerAngles = new Vector3(130, 90, 90); GetComponent <AudioSource>().enabled = false; transform.SetParent(GameData.Instance.Map.transform); StartCoroutine(ArmageddonSound()); } m_finish = false; m_coroutineMove = CoroutineManager.Instance.Register(m_custompath[0].Startmove(m_custompath[0], gameObject)); }
protected override void OnStart() { AssetManager.Effect.Retrieve("ItemAppearEffect", transform); m_uiweaponPack = UIManager.Instance.Open("UIWeaponPack", true) as UIWeaponPack; m_uiweaponPack.Init(m_uiName); m_coroutine = CoroutineManager.Instance.Register(Coroutine(0.1f)); }
private void BossSkillJudge(int num) { m_move = false; switch (num) { case 0: if (null != m_attackCommand) { CoroutineManager.Instance.Unregister(m_attackCommand); } m_attackCommand = CoroutineManager.Instance.Register(Skill1(Attack)); break; case 1: if (null != m_attackCommand) { CoroutineManager.Instance.Unregister(m_attackCommand); } m_attackCommand = CoroutineManager.Instance.Register(Skill2(Attack)); break; case 2: if (null != m_attackCommand) { CoroutineManager.Instance.Unregister(m_attackCommand); } m_attackCommand = CoroutineManager.Instance.Register(Skill3(Attack)); break; } }
public override void Move() { //곡선으로 이동하는 것을 보이게 하기 위해 노드를 3개 사용한다. //노드 수를 홀수로 맞춰놓아야 이용이 가능하다. if (m_customIndex < m_customPath.m_nodeCount - 1) { m_pathdata = BetweenMove(m_customPath, m_customIndex); if (null != m_moveCommand) { CoroutineManager.Instance.Unregister(m_moveCommand); } m_moveCommand = CoroutineManager.Instance.Register(m_pathdata.FinishActionPutOnPath(this.transform, m_pathdata, true, () => Attack())); m_customIndex += 2; } else { m_customPath.m_nodes = GetReaptPatrolPath(m_customPath); m_customPath.NodeReset(); m_customIndex = 0; m_pathdata = BetweenMove(m_customPath, m_customIndex); if (null != m_moveCommand) { CoroutineManager.Instance.Unregister(m_moveCommand); } m_moveCommand = CoroutineManager.Instance.Register(m_pathdata.FinishActionPutOnPath(this.transform, m_pathdata, true, () => Attack())); m_customIndex += 2; } }
/// <summary> /// 애니메이션 start됬을때 실행되는 함수. 기본 변수들 세팅과 등장 애니메이션을 실행해준다. /// </summary> public override void OnStart() { m_data.agent = GetComponent <NavMeshAgent>(); m_data.agent.enabled = false; m_data.target = null; m_bossHpCount = Character.m_actorUIData.bossHPPos.Length; m_bosshp = CharacterTable.GetProperty(Character.name).hp; m_first = true; m_bossTarget = GetComponent <UIBossTarget>(); if (isactiveskill) { Character.AnimatorAction.Initialize <AnimatorActionDroneBoss>(); } else { Character.AnimatorAction.Initialize <AnimatorActionBoss>(); } //보스 등장 애니메이션 실행을 위한 세팅. Character.AnimatorAction.Action(AnimatorState.Appear, true); //보스 약점 부위를 나타내는 변수. m_bossTargetpart = 0; if (m_hpState.Length > 0) { m_curHpState = m_hpState[0]; } //m_rigidbodys = transform.GetComponentsInChildren<Rigidbody>(); //for (int y = 0; y < m_rigidbodys.Length; ++y) //{ // m_rigidbodys[y].useGravity = true; // m_rigidbodys[y].isKinematic = true; //} //m_bossTarget.Initialize(m_target, m_colider); //m_bossHpBar = new UIBossHP[m_bossHpCount]; //보스의 타겟에 hp를 띄울 장소를 설정합니다. for (int i = 0; i < m_bossHpCount; ++i) { //m_bossHpBar[i] = GetComponent<BossInfoBoss>().bosshpBar; m_bossHpBar[i] = UIManager.Instance.Open("UIBossHP", true) as UIBossHP; m_bossHpBar[i].TargetInfo = Character.m_actorUIData.bossHPPos[i]; //hp 갯수 구분을 위해서 보스 이름 설정. m_bossHpBar[i].Initialize(); m_bossHpBar[i].Invisible(); m_bossHpBar[i].HpSetup(m_bossHpCount, m_bosshp); //FX fx = AssetManager.FX.Retrieve("Boss_Target"); //fx.transform.parent = m_target[i].gameObject.transform; //fx.transform.position = m_target[i].transform.FindChild("Boss_Target").position; } m_bosshpcorutineCommand = CoroutineManager.Instance.Register(BosstargetFlicker()); //m_damagetestcorutineCommand = CoroutineManager.Instance.Register(Damage()); }
/// <summary> /// Scheduled the routine to run (on the main thread) /// </summary> public static void StartRoutine(CoroutineCommand info) { if (IsApplicationQuit) { return; } //Make sure we are in the main thread if (!IsMainThread) { lock (syncRoot) { PendingCoroutineInfo.Add(info); } } else { if (UnityTask.DisableCoroutineYields) { RunCoroutineWithoutYields(Instance.RunCoroutineInfo(info)); } else { Instance.StartCoroutine(Instance.RunCoroutineInfo(info)); } } }
protected override void DirectingOnInitialize(params object[] parameters) { if (RockType.Armageddon == m_rockType) { return; } foreach (object element in parameters) { if (element is CustomPath) { m_custompath[0] = (CustomPath)element; } else if (element is Quaternion) { rot = (Quaternion)element; } } m_coroutineRestortime = null; m_physicsObjects.SetActive(false); m_mshRend = GetComponent <MeshRenderer>(); m_mshRend.enabled = true; m_rig = GetComponent <Rigidbody>(); m_rig.isKinematic = false; }
public override void CountCheck() { if (m_direction.Member == PlayerManager.Instance.GetPlayerList.Count) { m_hostcheck = CoroutineManager.Instance.Register(HoverHostCheck()); } }
public override void OnEnd() { if (null != m_coroutineCommand) { CoroutineManager.Instance.Unregister(m_coroutineCommand); m_coroutineCommand = null; } }
public override void OnStart() { m_direction.Finish = false; m_coroutineCommand = CoroutineManager.Instance.Register(m_direction.m_custompath[0].Startmove(m_direction.m_custompath[0], this.gameObject)); StartCoroutine(RotRecovery()); }
protected override void Directingending() { if (coroutine != null) { CoroutineManager.Instance.Unregister(coroutine); coroutine = null; } }
protected override void Directingending() { if (null != m_coroutine) { CoroutineManager.Instance.Unregister(m_coroutine); m_coroutine = null; } }
public override void OnEnd() { if (null != m_order) { CoroutineManager.Instance.Unregister(m_order); m_order = null; } }
IEnumerator RunCoroutineInfo(CoroutineCommand info) { yield return(StartCoroutine(info.Coroutine)); if (info.OnComplete != null) { info.OnComplete(); } }
/// <summary> /// 공격당했을 때 실행되는 애니메이션 함수. /// </summary> /// <param name="damageData"></param> public override void OnAttacked(DamageData damageData) { m_bossHpBar[m_bossTargetpart].Damage(damageData.ResultDamage); if (damageData.ResultDamage != 0 && m_bossdelaycorutineCommand == null) { m_bossdelaycorutineCommand = CoroutineManager.Instance.Register(BossDelay()); } //타겟이 켜져서 공격받는 중에 타겟의 hp가 0이되면 작동합니다. //0이 되면 처음 코루틴을 끄고 타겟의 폭발 fx를 실행합니다. //다음 순서의 타겟을 켭니다. if (m_bossHpBar[m_bossTargetpart].Close()) { if (null != m_bosshpcorutineCommand) { CoroutineManager.Instance.Unregister(m_bosshpcorutineCommand); m_bosshpcorutineCommand = null; } if (null != m_bossdelaycorutineCommand) { CoroutineManager.Instance.Unregister(m_bossdelaycorutineCommand); m_bossdelaycorutineCommand = null; } m_bossTarget.InVisibleObj(m_bossTargetpart); m_bossHpBar[m_bossTargetpart].Invisible(); m_bossTarget.VisibleColider(m_bossTargetpart); if (null != DeadExplotion[m_bossTargetpart + 1] && !DeadExplotion[m_bossTargetpart + 1].activeSelf) { DeadExplotion[m_bossTargetpart + 1].SetActive(true); } m_bossTargetpart = HpCheck(m_bossTargetpart); if (-1 == m_bossTargetpart) { OnDeath(); } m_bosshpcorutineCommand = CoroutineManager.Instance.Register(BosstargetFlicker()); } if (damageData != null && m_data.target != null && damageData.Attacker != null) { m_data.target = damageData.Attacker.transform; } if (activeHPUpdate) { Update_HpAction(Character.Status.HP, Character.Status.MaxHP); } //UIManager.Instance.OpenDamageText(Character.m_actorUIData.hpPos, damageData.ResultDamage.ToString()); }
public override void OnEnd() { GameData.Instance.HoverCraftSegTwo = null; if (m_coroutineCommand != null) { CoroutineManager.Instance.Unregister(m_coroutineCommand); m_coroutineCommand = null; } EventManager.Instance.RemoveReceiver <IEventDirection>(this); }
public override void Attack() { //if (AILogic.TargetDistance(this.transform, CurrentTarget) <= skills[0].SkillRange) //{ // m_currentTargetVectordir = (CurrentTarget.position - transform.position).normalized; // float angle = Mathf.Acos(Vector3.Dot(new Vector3(m_currentTargetVectordir.x, m_currentTargetVectordir.y, m_currentTargetVectordir.z), transform.forward)) * Mathf.Rad2Deg; // //if (Team == TeamFlag.Boss) // // Debug.Log(4); // // 0의 근사치로 잡힐경우 처리가 애매해져 float.IsNaN(angle) 추가 // if (angle < SightAngle || float.IsNaN(angle)) // { // if (!skills[0].IsCooltime()) // { // 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); // } // } // else // { // RotateUpdate(this.transform, CurrentTarget.position, m_rotSpeed); // } // } // else // { // RotateUpdate(this.transform, CurrentTarget.position, m_rotSpeed); // } //} //else //{ // RotateUpdate(this.transform, CurrentTarget.position, m_rotSpeed); //} //if (!skills[0].IsCooltime()) //{ // 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_attackCommand) { CoroutineManager.Instance.Unregister(m_attackCommand); } m_attackCommand = CoroutineManager.Instance.Register(TimeAttack()); }
private IEnumerator moveStart() { coroutine = CoroutineManager.Instance.Register(m_custompath[0].Startmove(m_custompath[0], this.gameObject)); while (!m_finish) { yield return(null); } CoroutineManager.Instance.Unregister(coroutine); coroutine = null; StartCoroutine(DelayRestore()); }
//공격 받았을때 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; } }
private IEnumerator Seg1HoverEndActive(Direction direction) { while (!direction.Finish) { yield return(null); } GameData.Instance.Hover1.ActiveEnd = true; GameData.Instance.Hover1.transform.GetComponent <HoverBoardSegOne>().HoverEndActive(); GameData.Instance.Hover2.transform.GetComponent <HoverBoardSegOne>().HoverEndActive(); CoroutineManager.Instance.Unregister(m_coroutineCommand); m_coroutineCommand = null; }
private IEnumerator DelayRestore() { yield return(new WaitForSeconds(restoreTime)); m_finish = false; coroutine = CoroutineManager.Instance.Register(m_custompath[1].Startmove(m_custompath[1], this.gameObject)); while (!m_finish) { yield return(null); } Restore(); }
public override void OnStart() { if (UserType.Host == GameData.Instance.UserType) { m_coroutine = CoroutineManager.Instance.Register(Emergency()); } else { m_UIMovement = UIManager.Instance.Open("UIMovement") as UIMovement; } Invoke("CheckActive", 1f); }
public void Stop(bool slowStop = false) { if (slowStop) { CoroutineManager.Instance.Unregister(m_coroutineCommand); m_coroutineCommand = null; StartCoroutine(SlowStop()); } else { CoroutineManager.Instance.Unregister(m_coroutineCommand); m_coroutineCommand = null; } }
public void Seg1HoverMove() { GameData.Instance.Hover1.Finish = false; m_coroutineCommand = CoroutineManager.Instance.Register(m_customPath[0].Startmove(m_customPath[0], this.gameObject, true, 2, GameData.Instance.Hover1.transform)); for (int i = 0; i < GameData.Instance.hoverLandingPos.Length; ++i) { AssetManager.Effect.Retrieve("FX_BoardLandingDust", GameData.Instance.hoverLandingPos[i]); } StartCoroutine(Seg1HoverEndActive(GameData.Instance.Hover1)); }
public void HoverCraftFall() { m_smoke.SetActive(true); StartCoroutine(HoverCraftFallBlend()); for (int i = 0; i < m_engine_Booster.Length; ++i) { m_engine_Booster[i].SetActive(false); } StartCoroutine(FallRotate()); StartCoroutine(Explosion()); m_coroutineCommand = CoroutineManager.Instance.Register(m_direction.m_custompath[0].Startmove(m_direction.m_custompath[0], this.gameObject)); }
public IEnumerator SegTwo() { m_finish = false; m_coroutineMove = CoroutineManager.Instance.Register(m_custompath[0].Startmove(m_custompath[0], gameObject)); while (!m_finish) { yield return(null); } m_rig.useGravity = true; RockCrash(); }
private IEnumerator <CoroutinePhase> Appear() { m_direction.Finish = false; m_movecoroutine = CoroutineManager.Instance.Register(m_direction.m_custompath[0].Startmove(m_direction.m_custompath[0], gameObject)); while (!m_direction.Finish) { yield return(null); } CoroutineManager.Instance.Unregister(m_movecoroutine); HoverMake(); transform.SetParent(GameData.Instance.Map.transform); }
public void Move(int num, bool burst = false) { m_currentPathNum = num; if (burst) { m_coroutineCommand = CoroutineManager.Instance.Register(m_customPath[num].Startmove(m_customPath[num], this.gameObject, false, 15)); GameData.Instance.HoverCraftSegTwo.m_wind.SetActive(false); StartCoroutine(WindCheck(num)); } else { m_coroutineCommand = CoroutineManager.Instance.Register(m_customPath[num].Startmove(m_customPath[num], this.gameObject, false, 7)); } }
/// <summary> /// Scheduled the routine to run (on the main thread) /// </summary> public static void StartRoutine(CoroutineCommand info) { if (IsApplicationQuit) return; //Make sure we are in the main thread if (!IsMainThread) { lock (syncRoot) { PendingCoroutineInfo.Add(info); } } else { Instance.StartCoroutine(Instance.RunCoroutineInfo(info)); } }
IEnumerator RunCoroutineInfo(CoroutineCommand info) { yield return StartCoroutine(info.Coroutine); if (info.OnComplete != null) info.OnComplete(); }