private void OnMouseDown() { if (!victoryPanel.gameObject.activeSelf && !menu.gameObject.activeSelf && !options.gameObject.activeSelf) { spriteRenderer.material.color = Color.grey; soundFX.playMouseDownOperationClip(); } }
private void OnMouseDown() { if (Input.GetMouseButtonDown(0) && !EventSystem.current.IsPointerOverGameObject()) { soundFX.playMouseDownOperationClip(); spriteRenderer.material.color = Color.grey; Vector3 mousePos = Input.mousePosition; mousePos = Camera.main.ScreenToWorldPoint(mousePos); rowScript.SetStartPosX(mousePos.x - transform.parent.transform.position.x); rowScript.SetStartPosY(mousePos.y - transform.parent.transform.position.y); rowScript.SetIsDragged(true); } foreach (Transform child in transform.parent.transform) { if (child.tag == "Number") { child.GetComponent <SpriteRenderer>().sortingOrder = 6; } } }