Exemplo n.º 1
0
    private void SpawnAbilityBalls(AbilityBall.Abilities ability, int id)
    {
        int ballsToSpawn = 1;

        if (ability == AbilityBall.Abilities.storageBall)
        {
            ballsToSpawn = 5;
        }
        int index = id * maxNumberOfAbilityBalls + currentAbilityIndex[id];

        for (int i = 0; i < ballsToSpawn; ++i)
        {
            AbilityBall obj = Instantiate(abilityBallPrefabs[(int)ability]);
            obj.Initialize(this);
            obj.Despawn();
            abilityBalls[index] = obj;
            currentAbilityIndex[id]++;
            index++;
        }
    }
Exemplo n.º 2
0
 public int GetIdOfAbilityBall(AbilityBall ball)
 {
     return(abilityBalls.IndexOf(ball));
 }