Exemplo n.º 1
0
    void Shot(PaddleController playerScript)
    {
        var obj = ObjectPooler.instance.GetPooledObject();

        if (obj != null)
        {
            obj.transform.position = transform.position;
            obj.SetActive(true);
            playerScript.DecreasingBalls();
        }
    }
Exemplo n.º 2
0
    public void Shot(PaddleController playerScript)
    {
        var obj = ObjectPooler.instance.GetPooledObject();

        SpriteRenderer sp = obj.GetComponentInChildren <SpriteRenderer>();

        sp.color = paddleSprite.color;
        obj.tag  = SetTag(sp.color);
        print(obj);
        if (obj != null)
        {
            obj.transform.position = transform.position;
            obj.SetActive(true);
            if (AudioManager.instance != null)
            {
                AudioManager.instance.Play("Shot");
            }
            playerScript.DecreasingBalls();
        }
    }