Esempio n. 1
0
 public void CheckPerfectWave()
 {
     if (parashootClear <= 0)
     {
         if (IsPerfect)
         {
             MainSoundSrc.PlaySound("right");
             Game3Global.BirdOK();
             Game3Global.AddScore(10000);
         }
         Destroy(gameObject);
     }
 }
Esempio n. 2
0
        // Update is called once per frame
        void Update()
        {
            Vector2 pos         = TouchInterface.GetTouchPosition();
            bool    isTouchDown = TouchInterface.GetTouchDown();
            bool    isTouchUp   = TouchInterface.GetTouchUp();

            if (isTouchDown && GetComponent <Collider2D>().OverlapPoint(pos))
            {
                if (Game3Global.pGlobal.dragObject == null)
                {
                    Game3Global.pGlobal.dragObject = this;
                    IsTouch = true;
                }
            }
            if (isTouchUp && Game3Global.pGlobal.dragObject == this)
            {
                //calculate score
                if (Game3Global.pGlobal.boxObject != null)
                {
                    if (Game3Global.pGlobal.boxObject.type == this.type)
                    {
                        //correct
                        MainSoundSrc.PlaySound("right");
                        Game3Global.BirdOK();
                        Game3Global.AddScore(300);
                        Game3Global.AddCombo();
                        Game3_LvlingStat.AddEXP();
                        parentWave.ParashootClear();
                        Destroy(this.gameObject);
                    }
                    else
                    {
                        MainSoundSrc.PlaySound("wrong");
                        Game3Global.BirdWrong();
                        Game3Global.BrokeCombo();
                        Game3Global.DecreaseLife();
                        parentWave.ParashootClear(false);
                        Destroy(this.gameObject);
                    }
                }
                Game3Global.pGlobal.dragObject = null;
                IsTouch = false;
            }
            if (IsTouch)
            {
                touchPos = pos;
            }
            else
            {
                if (IsEnterTrash)
                {
                    if (type != ParashootType.PARA_OTHER)
                    {
                        MainSoundSrc.PlaySound("wrong");
                        Game3Global.BirdWrong();
                        Game3Global.BrokeCombo();
                        Game3Global.DecreaseLife();
                        parentWave.ParashootClear(false);
                    }
                    else
                    {
                        MainSoundSrc.PlaySound("bin");
                        parentWave.ParashootClear();
                    }
                    Game3Global.TrashEnter();
                    Destroy(this.gameObject);
                }
            }
            UpdatePosition();
        }