Exemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player" && IsAlive)
        {
            AudioSource.PlayClipAtPoint(itemPick, transform.position);
            WeaponBehaviour wb = other.gameObject.GetComponent <WeaponBehaviour>();
            if (wb.firstWeapon)
            {
                switch (type)
                {
                case POWER_TYPE.DAMAGE:
                    wb.DoubleDamage();
                    Kill();
                    break;

                case POWER_TYPE.HEALTH:
                    other.GetComponent <Player>().RestoreLife(20);
                    break;

                case POWER_TYPE.AMMO:
                    wb.AddAmmoWeaponsEquiped(15);
                    break;

                case POWER_TYPE.LAST:
                    break;

                default:
                    break;
                }
                UI_Game.GetInstance().ItemPicked();
                Kill();
            }
        }
    }
Exemplo n.º 2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "WeaponItem")
     {
         SetWeapon(other.GetComponent <WeaponItem>().GetIndex());
         other.gameObject.SetActive(false);
         UI_Game.GetInstance().ItemPicked();
     }
 }
Exemplo n.º 3
0
    private void SetWeapon(int v)
    {
        switch (v)
        {
        case 0:
            firstWeapon   = weaponList[v];
            currentWeapon = firstWeapon;
            firstWeapon.gameObject.SetActive(true);
#if UNITY_ANDROID
            GetComponent <MobileControls>().ActivateAllFunctions();
#endif
            UI_Game.GetInstance().ActivateAllUI(firstWeapon);
            break;

        case 1:
            secondaryWeapon = weaponList[v];
            ChangeWeapons();
            break;

        default:
            break;
        }
        currentWeapon.WeaponSelected();
    }
Exemplo n.º 4
0
 public void WinGame()
 {
     win = true;
     UI_Game.GetInstance().WinState();
 }