public BallPackBase GetAvailableBallPack(BallPackType ballPackType)
        {
            if (_ballPackBases == null)
            {
                _ballPackBases = new List <BallPackBase>();
            }

            var ball = _ballPackBases?.FirstOrDefault(x => !x.IsActive && x.BallPackType == ballPackType);

            if (ball == null)
            {
                ball = AssetManager.Instance.GetBallPack(ballPackType);
                ball = Instantiate(ball, transform);
                ball.Initialize();
                _ballPackBases?.Add(ball);
            }

            ball.Activate();
            return(ball);
        }
Exemple #2
0
 public BallPackBase GetBallPack(BallPackType ballPackType)
 {
     return(_ballPackBases?.FirstOrDefault(x => x.BallPackType == ballPackType));
 }