Esempio n. 1
0
 private void ReturnToPool(BallView ball)
 {
     _activeBalls.Remove(ball);
     _pool.Add(ball);
     ball.gameObject.SetActive(false);
     SetBallSettings(ball);
     ball.Init();
 }
Esempio n. 2
0
    public override void Init()
    {
        base.Init();

        m_view = GetComponent <BallView>();

        m_view.Init(this);
        this.StateTransion(new BallIdle());
    }
Esempio n. 3
0
    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);
    }