Exemple #1
0
    private void KeyCtrl()
    {
        if (Input.GetMouseButtonDown(0))
        {
            if (isCoolDown)
            {
                return;
            }
            Vector3 tapPosition = Input.mousePosition;
            tapPosition.z = 10;
            if (level <= allSprites.Count)
            {
                level++;
            }
            flashObj.SetActive(false);
            if (canFusion)
            {
                GameObject tapObj = Instantiate <GameObject>(ResourcesMng.ResourcesLoad("Tap_yes"), Vector3.zero, Quaternion.identity);
                tapObj.transform.position = Camera.main.ScreenToWorldPoint(tapPosition);
                if (GetComponent <AudioSource>() != null)
                {
                    GetComponent <AudioSource>().PlayOneShot(ResourcesMng.AudioClipLoad("SE/good-job-se"));
                }
                mainUI.Good();
                canFusion = false;
            }

            else
            {
                GameObject tapObj = Instantiate <GameObject>(ResourcesMng.ResourcesLoad("Tap_no"), Vector3.zero, Quaternion.identity);
                tapObj.transform.position = Camera.main.ScreenToWorldPoint(tapPosition);
                if (GetComponent <AudioSource>() != null)
                {
                    GetComponent <AudioSource>().PlayOneShot(ResourcesMng.AudioClipLoad("SE/miss"));
                }
                mainUI.Bad();
            }
            StartCoroutine(CoolDown());
        }
    }