コード例 #1
0
        public void Test_pool_creation()
        {
            DefaultBullet bullet = pool.GetPooledObject();

            Assert.IsNotNull(bullet);
            Assert.AreEqual(1, pool.ActiveObjectAmount);
        }
コード例 #2
0
        public void Test_pool_returns()
        {
            DefaultBullet bullet = pool.GetPooledObject();

            pool.ReturnToPool(bullet);

            Assert.IsFalse(bullet.isActiveAndEnabled);
            Assert.AreEqual(0, pool.ActiveObjectAmount);
        }
コード例 #3
0
        public IEnumerator Test_bullet_destruction()
        {
            DefaultBullet bullet = pool.GetPooledObject();

            bullet.Object.SetActive(true);
            yield return(new WaitForSeconds(bullet.MaxLifeTime + .1f));

            Assert.IsFalse(bullet.isActiveAndEnabled);
            Assert.AreEqual(pool.ActiveObjectAmount, 0);
        }
コード例 #4
0
        private void InitWithoutDependencies()
        {
#if UNITY_EDITOR
            Camera.main.orthographicSize *= 1.25f;
#else
            Camera.main.orthographicSize *= 2.0f;
#endif

            SaveUtil.InitializeSave();

            SpaceUtil.Init();

            // _ColorManager is a prefab field, and doesn't need initialized.
            _PoolManager.Init(in _ColorManager);

            WeaponResetTimer = new FrameTimer(InitialWeaponTime);
            WeaponRainTimer  = new LoopingFrameTimer(WeaponRainTime);

            OneUpRainTimer = new LoopingFrameTimer(OneUpRainTime);
            OneUpRainTimer.TimeUntilActivation = InitialOneUpRainDelay;

            _PowerupMenu.Init();
            _PowerupMenu.transform.position += new Vector3(0, 0, 0);

            VictimWasAutomatic = true;

            _GameOverGUI.Init();
            _Scoreboard.Init();

            SoundManager.Init(_AudioSource);
            SpriteBank.Init();
            NotificationManager.Init(_Notification);

            DefaultBullet.StaticInit();
            //DefaultExtraBullet.StaticInit();
            DefaultBulletBuffs.Init();

            _ParticleManager.Init();

#if !UNITY_EDITOR
            CanGameOver = true;
#else
            CanGameOver = false;
#endif
        }
コード例 #5
0
 public abstract void OnKill(Enemy enemy, DefaultBullet bullet);
コード例 #6
0
 public abstract void OnHit(Enemy enemy, DefaultBullet bullet, Vector3 hitPosition);