Пример #1
0
 void OnTriggerExit2D(Collider2D other)
 {
     if (other.tag == "GameBound")
     {
         //			Debug.Log("Item Lost");
         MainSoundSrc.PlaySound("wrong");
         Game3Global.BirdWrong();
         Game3Global.DecreaseLife();
         Game3Global.BrokeCombo();
         Destroy(this.gameObject);
     }
 }
Пример #2
0
 void OnTriggerExit2D(Collider2D other)
 {
     if (other.tag == "GameBound")
     {
         MainSoundSrc.PlaySound("wrong");
         Game3Global.BirdWrong();
         Game3Global.DecreaseLife();
         Game3Global.BrokeCombo();
         Destroy(this.gameObject);
     }
     if (other.tag == "Trash")
     {
         IsEnterTrash = false;
     }
 }
Пример #3
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();
        }