Example #1
0
    void OnTriggerEnter(Collider Get)
    {
        if (Get.tag == "coin")
        {
            Get.gameObject.SetActive(false);
            Get_Coin_Count += 1;
            if (_gm != null)
            {
                _gm.GETCOIN();
            }

            if (_SP != null)
            {
                _SP.SoundPlay(1);
            }
        }


        if (Get.tag == "DeathZone")
        {
            Debug.Log("Die");
            if (_PM.status != PlayerMoveStatus.Die)
            {
                _PM.status = PlayerMoveStatus.Die;
                //	Handheld.Vibrate ();
                this.gameObject.rigidbody.AddForce(0, -50f, 0);
                if (_gm != null)
                {
                    _gm.GAMEOVER();
                }

                if (_SP != null)
                {
                    _SP.SoundPlay(2);
                }
                if (_fade != null)
                {
                    _fade.FadeOut();
                }
            }
        }
    }