private void OnTriggerEnter(Collider other) { if (other.CompareTag("CodeBlock")) { global.CodeBlockDestroyer(other.gameObject, true); } }
// Update is called once per frame private void Update() { if (Input.GetKeyDown(key)) { gameObject.transform.position = new Vector3(gameObject.transform.position.x, gameObject.transform.position.y + 0.05f, gameObject.transform.position.z); if (codeblock != null) { particles[0].Play(); particles[1].Play(); global.CodeBlockDestroyer(codeblock); global.increaseScore(); codeblock = null; } else { global.breakCombo(); } } if (Input.GetKeyUp(key)) { gameObject.transform.position = new Vector3(gameObject.transform.position.x, gameObject.transform.position.y - 0.05f, gameObject.transform.position.z); } }