// 특화 정보 로딩 public override IEnumerator LoadContext() { IEnumerator loadPlayer = LoadBasicPlayer(); while (loadPlayer.MoveNext()) { yield return loadPlayer.Current; } // 적기 로딩 ///////////////////// GameSystem._Instance.PoolStackShape("Common/Boss_Orange", 1); GameSystem._Instance.PoolStackMover<Boss>(1); GameSystem._Instance.PoolStackShape("Common/Effect_BossCrashOrange", 1); GameSystem._Instance.PoolStackMover<Effect>(1); // 탄 로딩 /////////////////// // 외양 로딩 GameSystem._Instance._UILoading.SetProgress("Loading Bullets 1/2"); yield return null; GameSystem._Instance.PoolStackShape("Common/Bullet_Blue", 210); GameSystem._Instance._UILoading.SetProgress("Loading Bullets 2/2"); yield return null; GameSystem._Instance.PoolStackShape("Common/Bullet_Red", 125); // 클래스 로딩 GameSystem._Instance.PoolStackMover<Bullet>(210); // 코루틴 _coroutineManager.StopAllCoroutines(); _coroutineManager.RegisterCoroutine(Main()); // 메인 코루틴 등록 }
public BTState Attack() { Vector2 orgPos = target.transform.position; Vector2 targetPos = target.transform.position; float distance = Mathf.Sqrt((orgPos - targetPos).sqrMagnitude); if (distance < attackDistance) { if (Time.time - lastAttackTime > attackDelay) { CoroutineManager.RegisterCoroutine(FireCoroutine()); lastAttackTime = Time.time; } if (!target.enabled) { target = null; return(BTState.SUCCESS); } return(BTState.CONTINUE); } else { return(BTState.FAILURE); } }
static public void ShowPlayerLoseBanner() { GameObject loseBanner = ObjectPoolManager.GetObjectPool(instance.playerLoseBannerPrefab).PopItem(); loseBanner.transform.position = new Vector2(0, -Camera.main.pixelHeight / 2); loseBanner.transform.SetParent(instance.canvasObject.transform); CoroutineManager.RegisterCoroutine(AnimationUtil.MoveAnimationCoroutine(loseBanner, loseBanner.transform.position, new Vector2(0, 0), 2f)); CoroutineManager.RegisterCoroutine(AnimationUtil.DestoryAnimationCoroutine(loseBanner, 10f)); }
public BTState Fire() { if (Time.time - lastShootTime <= fireDelay) { return(BTState.CONTINUE); } lastShootTime = Time.time; CoroutineManager.RegisterCoroutine(FireCoroutine()); return(BTState.SUCCESS); }
// 특화 정보 로딩 public override IEnumerator LoadContext() { IEnumerator loadPlayer = LoadBasicPlayer(); while (loadPlayer.MoveNext()) { yield return loadPlayer.Current; } // 적기 로딩 ///////////////////// GameSystem._Instance.PoolStackShape("Common/Boss_Miku", 1); GameSystem._Instance.PoolStackMover<Boss>(1); GameSystem._Instance.PoolStackShape("Common/Effect_BossCrashMiku", 1); GameSystem._Instance.PoolStackMover<Effect>(1); // 탄 로딩 /////////////////// // 외양 로딩 GameSystem._Instance._UILoading.SetProgress("Loading Bullets"); yield return null; GameSystem._Instance.PoolStackShape("Common/Bullet_Blue", 270); GameSystem._Instance.PoolStackShape("Common/Bullet_Red", 27); // 클래스 로딩 GameSystem._Instance.PoolStackMover<Bullet>(270); // 스테이지 텍스트 if (_uiStageText == null) { Object prefab = Resources.Load(Define._uiStageText); GameObject obj = Object.Instantiate(prefab) as GameObject; obj.name = prefab.name; _uiStageText = obj.GetComponent<UIStageText>(); _uiStageText.Initialize(GameSystem._Instance._LayoutGameArea.transform); } _uiStageText.SetActive(false); _uiStageText.SetAlign(TextAnchor.MiddleCenter); _uiStageText.SetAnchorPoistion(0.5f, 0.5f); _uiStageText.SetSize(_stageTextDefaultWidth, _stageTextDefaultHeight); _uiStageText.SetText(string.Empty); // UI GameSystem._Instance._MoveInputArea.SetVisible(false); GameSystem._Instance._PauseInputArea.SetVisible(false); // 코루틴 _coroutineManager.StopAllCoroutines(); _coroutineManager.RegisterCoroutine(Main()); // 메인 코루틴 등록 }
public void UseCard(int index) { Card card = uiCardList[index].card; card.cardGuide.Disable(); ObjectPoolManager.GetObjectPool(uiCardPrefab).PushItem(uiCardList[index].gameObject); uiCardList.RemoveAt(index); card.Active(GameData.player[(int)Team.TEAM_PLAYER], CameraUtil.GetMouseWorldPosition(Camera.main)); for (int i = index; i < uiCardList.Count; i++) { Rect newCardRect = GetCardPosition(i); CoroutineManager.RegisterCoroutine(AnimationUtil .MoveAnimationCoroutine(uiCardList[i].gameObject, uiCardList[i].gameObject.transform.localPosition, newCardRect.center, 0.5f)); uiCardList[i].index = i; } GameData.player[(int)Team.TEAM_PLAYER].RemoveCardInHand(index); }
public void AddCard(Card card) { GameObject newCardObj = ObjectPoolManager.GetObjectPool(uiCardPrefab).PopItem(); UICard uiCard = newCardObj.GetComponent <UICard>(); uiCard.transform.SetParent(gameObject.transform); uiCard.cardList = this; uiCard.card = card; uiCardList.Add(uiCard); uiCard.index = uiCardList.Count - 1; Rect cardTargetRect = GetCardPosition(uiCardList.Count - 1); Rect cardSizeRect = newCardObj.GetComponent <RectTransform>().rect; newCardObj.transform.localScale = new Vector2(cardTargetRect.width / cardSizeRect.width, cardTargetRect.height / cardSizeRect.height); Rect cardOrgRect = GetCardPosition(capacity - 1); CoroutineManager.RegisterCoroutine(AnimationUtil.MoveAnimationCoroutine(newCardObj, cardOrgRect.center, cardTargetRect.center, 0.5f)); }
public IEnumerator SpellCoroutine(Player player, Vector2 position) { if (preEffectPrefab != null) { GameObject preEffect = GameData.field.Spawn(preEffectPrefab, position); CoroutineManager.RegisterCoroutine(AnimationUtil.DespawnAnimationCoroutine(preEffect, preDelay)); } yield return(new WaitForSeconds(preDelay)); List <GameEntity> gameEntityList = GameData.field.FindEnemyGameEntityRadius(position, player.team, radius); for (int i = 0; i < gameEntityList.Count; i++) { gameEntityList[i].HitDamage(damage); } if (damageEffectPrefab != null) { GameObject damageEffect = GameData.field.Spawn(damageEffectPrefab, position); CoroutineManager.RegisterCoroutine(AnimationUtil.DespawnAnimationCoroutine(damageEffect, damageEffectExposureTime)); } }
// 특화 정보 로딩 public override IEnumerator LoadContext() { IEnumerator loadPlayer = LoadBasicPlayer(); while (loadPlayer.MoveNext()) { yield return loadPlayer.Current; } // 적기 로딩 ///////////////////// GameSystem._Instance.PoolStackShape("Common/Boss_Red", 1); GameSystem._Instance.PoolStackMover<Boss>(1); GameSystem._Instance.PoolStackShape("Common/Effect_BossCrashRed", 1); GameSystem._Instance.PoolStackMover<Effect>(1); // 탄 로딩 /////////////////// // 외양 로딩 GameSystem._Instance._UILoading.SetProgress("Loading Bullets 1/3"); yield return null; GameSystem._Instance.PoolStackShape("Common/Bullet_Red", 41); GameSystem._Instance.PoolStackShape("Common/Bullet_Blue", 86); GameSystem._Instance.PoolStackShape("Common/Bullet_BlueLarge", 2); GameSystem._Instance.PoolStackShape("Common/Bullet_RedLarge", 2); GameSystem._Instance._UILoading.SetProgress("Loading Bullets 2/3"); yield return null; GameSystem._Instance.PoolStackShape("Common/Bullet_BlueSmall", 90); GameSystem._Instance._UILoading.SetProgress("Loading Bullets 3/3"); yield return null; GameSystem._Instance.PoolStackShape("Common/Bullet_RedSmall", 114); // 클래스 로딩 GameSystem._Instance.PoolStackMover<Bullet>(60); GameSystem._Instance.PoolStackMover<AwayBullet>(86); GameSystem._Instance.PoolStackMover<PlacedBullet>(160); GameSystem._Instance.PoolStackMover<SpiralPlacedShooterBullet>(4); // 코루틴 _coroutineManager.StopAllCoroutines(); _coroutineManager.RegisterCoroutine(Main()); // 메인 코루틴 등록 }
public override void Init(string shapeSubPath, float x, float y, float angle) { base.Init(shapeSubPath, x, y, angle); _coroutineManager.RegisterCoroutine(MoveMain()); }
public override void Active(Player player, Vector2 position) { CoroutineManager.RegisterCoroutine(SpellCoroutine(player, position)); }
public void Enable() { isEnabled = true; CoroutineManager.RegisterCoroutine(VisibleCoroutine()); }