Пример #1
0
    // Update is called once per frame
    /// <summary>
    /// This activate once the player touch the item
    /// </summary>
    /// <param name="obj">check to see if the obj is the game player</param>
    void OnTriggerEnter(Collider obj)
    {
        if (obj.tag == "Player" && !isTouchItem)
        {
            switch (itemPowerIndex)
            {
            case 0:
                SoundController.playPickup = true;
                HudManager.jumpCount       = 1;
                turnOffItem();
                break;

            case 1:
                SoundController.playPickup = true;
                HudManager.shieldCount     = 1;
                turnOffItem();
                break;

            case 2:
                SoundController.playPickup = true;
                HudManager.PickUpCombo();
                turnOffItem();
                break;

            case 3:
                SoundController.playBoost = true;
                staticController.boost    = true;
                turnOffItem();
                break;
            }
        }
    }