Пример #1
0
        /// <summary>
        /// Creates a new Danmaku from the pool.
        /// </summary>
        public Danmaku Get(DanmakuConfig config)
        {
            CheckCapacity(1);
            var state = config.CreateState();

            InitialStates[ActiveCount] = state;
            Times[ActiveCount]         = 0f;
            var danmaku = new Danmaku(this, activeCountArray[0]++);

            danmaku.ApplyState(state);
            return(danmaku);
        }
Пример #2
0
 /// <inheritdoc/>
 void IFireable.Fire(DanmakuConfig config) => Fire(config);
Пример #3
0
 /// <summary>
 /// Creates and fires a single bullet based on a given config.
 /// </summary>
 /// <param name="config">the config for creating the bullet</param>
 /// <returns>the created bullet</returns>
 public Danmaku Fire(DanmakuConfig config) => Pool.Get(config);