void Shot(PaddleController playerScript) { var obj = ObjectPooler.instance.GetPooledObject(); if (obj != null) { obj.transform.position = transform.position; obj.SetActive(true); playerScript.DecreasingBalls(); } }
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(); } }