コード例 #1
0
    void OnMouseDown()
    {
        if (!selectable || pattern.display)
        {
            return;
        }
        if (pattern.patternCount != 0)
        {
            if (pattern.current.color == color && pattern.current.species == species)
            {
                //Destroy (gameObject);
                pattern.foundCollectible();
                AudioSource.PlayClipAtPoint(success, transform.position);
                //Play Bubble Animation
                gameObject.GetComponentInChildren <Bubble>().CorrectChoice();
            }
            else
            {
                levelManager.FailedPattern();
                //AudioSource.PlayClipAtPoint(fail, transform.position);
                StartCoroutine("PopWait", .5f);

                gameObject.GetComponentInChildren <Bubble>().InCorrectChoice();
            }
        }
    }
コード例 #2
0
 void OnMouseDown()
 {
     if (!selectable || pattern.display)
     {
         return;
     }
     if (pattern.patternCount != 0)
     {
         if (pattern.current.color == color && pattern.current.species == species)
         {
             Destroy(gameObject);
             pattern.foundCollectible();
             AudioSource.PlayClipAtPoint(success, transform.position);
         }
         else
         {
             levelManager.FailedPattern();
             AudioSource.PlayClipAtPoint(fail, transform.position);
         }
     }
 }