Beispiel #1
0
    IEnumerator ItemTimer(ItemManager.Types type)
    {
        yield return(new WaitForSeconds(model.itemEffectDuration));

        switch (type)
        {
        case ItemManager.Types.PowerPlus:
            powerPlusOn = false;
            break;

        case ItemManager.Types.MachineGun:
        case ItemManager.Types.Shotgun:
        case ItemManager.Types.HomingMissile:
            currentWeapon = Weapons.RegularGun;
            break;

        default:
            break;
        }
    }
Beispiel #2
0
    void UseItem(ItemManager.Types type)
    {
        switch (type)
        {
        case ItemManager.Types.EnergyPlus:
            model.RefillEnergy();
            break;

        case ItemManager.Types.PowerPlus:
            powerPlusOn = true;
            StartCoroutine(ItemTimer(type));
            break;

        case ItemManager.Types.BulletTime:
            if (onBulletTimeUsage != null)
            {
                onBulletTimeUsage();
            }
            break;

        case ItemManager.Types.MachineGun:
            currentWeapon = Weapons.MachineGun;
            StartCoroutine(ItemTimer(type));
            break;

        case ItemManager.Types.Shotgun:
            currentWeapon = Weapons.Shotgun;
            StartCoroutine(ItemTimer(type));
            break;

        case ItemManager.Types.HomingMissile:
            currentWeapon = Weapons.HomingMissile;
            StartCoroutine(ItemTimer(type));
            break;

        default:
            break;
        }
    }
Beispiel #3
0
 public void Initialize(float movementPerSecond, ItemManager.Types type)
 {
     this.movementPerSecond = movementPerSecond;
     this.type = type;
 }