Beispiel #1
0
 private IEnumerator SpawnEnemy()
 {
     while (true)
     {
         EnemyObjectPool.Instance.Spawn();
         yield return(YieldCache.WaitForSeconds(1.0f));
     }
 }
Beispiel #2
0
    private IEnumerator Die()
    {
        do
        {
            current_state = EnemyState.Die;
            animator.SetInteger("Enemy_State", ( int )current_state);
            // 죽는 모션이 실행되는 시간
            yield return(YieldCache.WaitForSeconds(0.332f));

            OnDie();
        }while (current_state.Equals(EnemyState.Die));
    }
Beispiel #3
0
        public IEnumerator <object> Transformation()
        {
            yield return((object)YieldCache.WaitForSeconds(0.65f));

            owner.view.charAppearance.ChangeMotion(ActionDetail.Default);
            SingletonBehavior <DiceEffectManager> .Instance.CreateCreatureEffect("Philip/Philip_Aura_Start", 1f, owner.view, owner.view, 1f);

            SoundEffectPlayer.PlaySound("Battle/Xiao_Vert");
            yield return((object)YieldCache.WaitForSeconds(0.8f));

            SingletonBehavior <BattleSceneRoot> .Instance.currentMapObject.SetRunningState(false);
        }
Beispiel #4
0
    private IEnumerator Attack()
    {
        if (!ReferenceEquals(target, null) && Vector2.SqrMagnitude(current_transform.position - target.current_transform.position) <= attack_range * attack_range)
        {
            Bullet bullet = BulletObjectPool.Instance.Spawn(prefab);
            bullet.Initialize(this, current_transform.position, (target.current_transform.position - current_transform.position).normalized);
        }
        else
        {
            target = null;
        }

        yield return(YieldCache.WaitForSeconds(attack_delay));

        StartCoroutine(Idle());
    }
Beispiel #5
0
    private IEnumerator FindEnemy()
    {
        while (true)
        {
            if (ReferenceEquals(target, null))
            {
                LinkedList <Enemy> .Enumerator enemy_enumerator = GameManager.Instance.enemy_enable_list.GetEnumerator();
                while (enemy_enumerator.MoveNext())
                {
                    if (Vector2.SqrMagnitude(current_transform.position - enemy_enumerator.Current.current_transform.position) <= attack_range * attack_range)
                    {
                        target = enemy_enumerator.Current;
                        break;
                    }
                }
            }

            yield return(YieldCache.WaitForSeconds(delay_time_to_find_enemies));
        }
    }