Beispiel #1
0
 AutoAttack[] generateAutoAttacks()
 {
     AutoAttack[] autoAttackWaves = new AutoAttack[3];
     autoAttackWaves[0] = WaveOne.create(this.prefabProjectile, projectileSpeed);
     autoAttackWaves[1] = WaveTwo.create(this.prefabProjectile, projectileSpeed);
     autoAttackWaves[2] = WaveThree.create(this.prefabSpikes);
     return(autoAttackWaves);
 }
Beispiel #2
0
    public static AutoAttack create(GameObject prefab, float speed)
    {
        WaveTwo attack = ScriptableObject.CreateInstance <WaveTwo>();

        attack.prefab = prefab;
        // damage half of total damage since two projectiles are created
        attack.damage = 25;
        attack.speed  = speed;
        return(attack);
    }