예제 #1
0
 void Start()
 {
     isToggleButton = true;
     soundTriggers  = GameObject.Find("SoundManager").GetComponentInChildren <musicTriggers> ();
     temp           = textOnOff.name;
     Debug.Log("target.name:" + textOnOff);
 }
    void Update()
    {
        indexCount  = lvl4scene2.counting;
        mscTriggers = GameObject.Find("SoundManager").GetComponent <musicTriggers>();


        // TODO: Create a separate script for loading first questions that forces its collider to enable after ~4s

        //if (this.gameObject.GetComponent<Lean.Touch.LeanSelectable>().IsSelected) {
        //    if (this.gameObject.tag=="True")
        //    {
        //            mscTriggers.PlaySingle(sfxclip[0]);
        //            ScoreManager.AddPoints(pointsToAdd);
        //            GameObject.Find("Counter Slider").GetComponent<Level4Scene2>().timeBar.value = 7f;
        //            GameObject.Find("Counter Slider").GetComponent<Level4Scene2>().counting += 1;
        //            lvl4scene2.changeQuestions(lvl4scene2.counting);
        //            lvl4scene2.changeUpperFrameQuestions(lvl4scene2.counting);
        //        Debug.Log("IsSelected: " + this.gameObject.tag);

        //        }
        //        if (this.gameObject.tag == "False")
        //        {
        //            mscTriggers.PlaySingle(sfxclip[1]);
        //            ScoreManager.AddPoints(pointsToAdd);
        //            HeartAndStars.MinusHeartAndStars(toBeDeducted);
        //            GameObject.Find("Counter Slider").GetComponent<Level4Scene2>().timeBar.value = 7f;
        //            GameObject.Find("Counter Slider").GetComponent<Level4Scene2>().counting += 1;
        //            lvl4scene2.changeQuestions(lvl4scene2.counting);
        //            lvl4scene2.changeUpperFrameQuestions(lvl4scene2.counting);
        //             Debug.Log("IsSelected: " + this.gameObject.tag);

        //    }

        //}
    }
    // public Lean.Touch.LeanSelect leanselect;


    void Start()
    {
        allowTouch   = true;
        mscTriggers  = GameObject.Find("SoundManager").GetComponent <musicTriggers>();
        whackerPause = GameObject.Find("LevelManager").GetComponent <WhackerPause>();
        allowClick   = false;
    }
    /// <summary>
    ///
    /// </summary>
    void Update()
    {
        //if (this.gameObject.GetComponent<Lean.Touch.LeanSelectable>().IsSelected)
        //{
        //    if (gameObject.tag == "Right")
        //    {
        //        mscTrigger.PlaySingle(sfxClip[0]);
        //        ScoreManager.AddPoints(pointsToAdd);
        //        this.gameObject.GetComponent<Animator>().enabled = false;
        //        this.gameObject.GetComponent<SpriteRenderer>().sprite = spr;
        //        Counter.AddCounter(counterToAdd);
        //        this.gameObject.GetComponent<Lean.Touch.LeanSelectable>().Deselect();
        //        StartCoroutine(doTransitionOfSprite());


        //    }
        //    else if (gameObject.tag == "Wrong")
        //    {
        //        mscTrigger.PlaySingle(sfxClip[1]);
        //        ScoreManager.AddPoints(pointsToAdd);
        //        this.gameObject.GetComponent<Animator>().enabled = false;
        //        this.gameObject.GetComponent<SpriteRenderer>().sprite = spr;
        //        HeartAndStars.MinusHeartAndStars(toBeDeducted);
        //        this.gameObject.GetComponent<Lean.Touch.LeanSelectable>().Deselect();
        //        StartCoroutine(doTransitionOfSprite());
        //    }


        // }


        mscTrigger = GameObject.Find("SoundManager").GetComponent <musicTriggers>();
        //if (Input.GetMouseButtonDown(0))
        //{
        //    if (tapping)
        //    {
        //        doubleTap = true;
        //        Debug.Log("DoubleTap");
        //        tapping = false;
        //    }
        //    else
        //    {
        //        tapping = true;
        //        tapTime = duration;

        //    }
        //}
        //if (tapping)
        //{
        //    tapTime = tapTime - Time.deltaTime;
        //    if (tapTime <= 0)
        //    {
        //        tapping = false;
        //        singleTap = true;
        //        Debug.Log("SingleTap");
        //    }
        //}
    }
    void Start()
    {
//		cor = doTransitionOfSprite;
        mscTrigger = GameObject.Find("SoundManager").GetComponent <musicTriggers>();
    }