// Update is called once per frame void Update() { if (Input.GetButtonDown("Fire1")) { if (grid.CanPlace(targetPixelRow, targetPixelColumn)) { grid.Place(targetPixelRow, targetPixelColumn, (GameObject)Instantiate(actualPixel)); audio.Play(); game.AddScore(1); } } }
// Update is called once per frame void Update() { if (Input.GetButtonDown("Fire1")) { if (grid.CanPlace(targetPixelRow, targetPixelColumn)) { Transform t = grid.Place(targetPixelRow, targetPixelColumn, (GameObject)Instantiate(actualPixel)); audio.Play(); game.AddScore(1); particleSystem.gameObject.transform.position = t.position; particleSystem.gameObject.SetActive(true); particleSystem.Play(); } } }