Esempio n. 1
0
    /// <summary>
    /// On shape completed event.
    /// </summary>
    private void OnShapeComplete()
    {
        bool allDone = true;

        List <Shape> shapes = new List <Shape> ();

        if (compoundShape != null)
        {
            shapes  = compoundShape.shapes;
            allDone = compoundShape.IsCompleted();

            if (!allDone)
            {
                shape = compoundShape.shapes [compoundShape.GetCurrentShapeIndex()];
                StartAutoTracing(shape);
            }
        }
        else
        {
            shapes.Add(shape);
        }

        if (allDone)
        {
            SaveShapeStatus(shapes);

            DisableHand();
            //brightEffect.GetComponent<ParticleEmitter> ().emit = false;
            try{
                GameObject.FindObjectOfType <GameManager> ().NextShape();
            }catch (System.Exception ex) {
            }
            foreach (Shape s in shapes)
            {
                Animator shapeAnimator = s.GetComponent <Animator> ();
                shapeAnimator.SetBool(s.name, false);
                shapeAnimator.SetTrigger("Completed");
            }

            ///Area.Show ();
            ///winDialog.Show ();

            ///GameObject.Find ("NextButton").GetComponent<Animator> ().SetTrigger ("Select");
            ///completeEffect.emit = true;
            if (completedSFX != null && effectsAudioSource != null)
            {
                CommonUtil.PlayOneShotClipAt(completedSFX, Vector3.zero, effectsAudioSource.volume);
            }
        }
        else
        {
            PlayCorrectSFX();
        }
    }
Esempio n. 2
0
    /// <summary>
    /// On shape completed event.
    /// </summary>
    private void OnShapeComplete()
    {
        bool allDone = true;

        List <Shape> shapes = new List <Shape> ();

        if (compoundShape != null)
        {
            shapes  = compoundShape.shapes;
            allDone = compoundShape.IsCompleted();

            if (!allDone)
            {
                shape = compoundShape.shapes [compoundShape.GetCurrentShapeIndex()];
                StartAutoTracing(shape);
            }
        }
        else
        {
            shapes.Add(shape);
        }

        if (allDone)
        {
            SaveShapeStatus(shapes);

            DisableHand();
            /*brightEffect.GetComponent<ParticleEmitter> ().emit = false;*/

            foreach (Shape s in shapes)
            {
                Animator shapeAnimator = s.GetComponent <Animator> ();
                shapeAnimator.SetBool(s.name, false);
                shapeAnimator.SetTrigger("Completed");
            }

            timer.Stop();
            Area.Show();
            winDialog.Show();
            GameObject.Find("NextButton").GetComponent <Animator> ().SetTrigger("Select");
            /*completeEffect.emit = true;*/
            if (completedSFX != null && effectsAudioSource != null)
            {
                CommonUtil.PlayOneShotClipAt(completedSFX, Vector3.zero, effectsAudioSource.volume);
            }
            AdsManager.instance.HideAdvertisment();
            AdsManager.instance.ShowAdvertisment(AdPackage.AdEvent.Event.ON_SHOW_WIN_DIALOG);
        }
        else
        {
            PlayCorrectSFX();
        }
    }