Ejemplo n.º 1
0
        /// <summary>
        /// Resumes current round enemies moving and shooting.
        /// </summary>
        public void ResumeCurrentRoundEntities()
        {
            foreach (var e in EnemyMoves)
            {
                e.Resume();
            }

            foreach (var enemy in EnemyShoots)
            {
                enemy.Resume();
            }

            m_PlayerShootController.ResumeAll();
            m_PlayerController.ResumeMovement();

            var aliveParticles = ParticleFactory.instance.GetLiveParticles();

            foreach (var p in aliveParticles)
            {
                p.Resume();
            }

            var projeciles = GameObject.FindObjectsOfType <Projectile>();

            foreach (var p in projeciles)
            {
                p.Resume();
            }

            var bombs = GameObject.FindObjectsOfType <Bomb>();

            foreach (var b in bombs)
            {
                b.Resume();
            }
        }
Ejemplo n.º 2
0
        private IEnumerator ResetAfterSeconds(float seconds)
        {
            yield return(new WaitForSeconds(seconds));

            if (OnPlayerDeathPreSpawn != null)
            {
                OnPlayerDeathPreSpawn();
            }

            transform.position = new Vector3(0f, -3f, 0f);

            float startWait = 0.08f;

            for (int i = 0; i < 8; i++)
            {
                foreach (var rend in spriteRenderers)
                {
                    rend.enabled = !rend.enabled;
                }

                yield return(new WaitForSeconds(startWait *= 0.9f));
            }

            foreach (var rend in spriteRenderers)
            {
                rend.enabled = true;
            }

            m_Collider.enabled = true;

            if (OnSpawn != null)
            {
                OnSpawn();
            }

            m_ShootController.BeginShooting();
            m_ShootController.ResumeAll();

            m_GameManager.OnPlayerRespawned();
        }