/// <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); }
/// <inheritdoc/> void IFireable.Fire(DanmakuConfig config) => Fire(config);
/// <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);