private void ReturnToPool(BallView ball) { _activeBalls.Remove(ball); _pool.Add(ball); ball.gameObject.SetActive(false); SetBallSettings(ball); ball.Init(); }
public override void Init() { base.Init(); m_view = GetComponent <BallView>(); m_view.Init(this); this.StateTransion(new BallIdle()); }
private BallView CreateBall() { BallView ball = Instantiate(_ballPrefab, gameObject.transform); SetBallSettings(ball); ball.gameObject.SetActive(false); ball.ReturnToPool = ReturnToPool; ball.AddPoints = AddPoints; ball.Init(); return(ball); }