Beispiel #1
0
        private void FireRandomSentinel()
        {
            var sentinels = SentinelPool.Where(x => SpaceUtil.SpriteIsInBounds(x));

            if (RandomUtil.TryGetRandomElement(sentinels, out PlayerBullet bullet))
            {
                FireSentinelForward(bullet);
            }
        }
Beispiel #2
0
        protected sealed override void OnInit()
        {
            Instance = this;

            SentinelPool           = PoolManager.Instance.BulletPool.GetPool <SentinelBullet>();
            SentinelProjectilePool = PoolManager.Instance.BulletPool.GetPool <SentinelProjectileBullet>();

            var sentinels = SentinelPool.GetMany <SentinelBullet>(NumSentinel);

            for (int i = 0; i < sentinels.Length; i++)
            {
                SentinelBullet sentinel = sentinels[i];
                sentinel.Index = i;
                sentinel.DeactivateSelf();
            }
        }