Exemplo n.º 1
0
    public void SpawnAttackerType(Attacker.Type type)
    {
        switch (type)
        {
        case Attacker.Type.Jeep:
            SpawnEnemy(m_EnemyJeepPrefab);
            break;

        case Attacker.Type.Tank:
            SpawnEnemy(m_EnemyTankPrefab);
            break;

        case Attacker.Type.HeavyTank:
            SpawnEnemy(m_EnemyHeavyTankPrefab);
            break;

        case Attacker.Type.Buggy:
            SpawnEnemy(m_EnemyBuggyPrefab);
            break;

        case Attacker.Type.Gunship:
            SpawnEnemy(m_EnemyGunshipPrefab);
            break;

        default:
            break;
        }
    }
Exemplo n.º 2
0
    public void SpawnAttackerType(string type)
    {
        Attacker.Type t = (Attacker.Type)Enum.Parse(typeof(Attacker.Type), type);
        int           cost;

        switch (t)
        {
        case Attacker.Type.Jeep: cost = 50; break;

        case Attacker.Type.Tank: cost = 150; break;

        case Attacker.Type.HeavyTank: cost = 250; break;

        case Attacker.Type.Buggy: cost = 50; break;

        case Attacker.Type.Gunship: cost = 100; break;

        default: cost = 50; break;
        }
        if (BattleManager.instance.stats.Money >= cost)
        {
            BattleManager.instance.stats.Money -= cost;
            SpawnAttackerType(t);
        }
    }