コード例 #1
0
    private bool IsValidAmmoFireSpawnPoint(Ammo currentAmmo, Transform enemyFireSpawPoint)
    {
        bool validSpawnPoint = false;

        if (enemyFireSpawPoint.CompareTag(currentAmmo.GetAmmoChildTag()))
        {
            validSpawnPoint = true;
            return(validSpawnPoint);
        }
        else
        {
            return(validSpawnPoint);
        }
    }
コード例 #2
0
    /* para que cada municao seja atirada apenas no ponto de origem desejado,
     * cada ponto de origem DO OBJETO UPGRADEPART tera filhos indicando
     * quais das municoes A,B OU C OU A,B E C poderão ser disparadas dela ;D */
    private bool IsValidAmmoFireSpawnPoint(Ammo currentAmmo, Transform WeaponFireSpawPoint)
    {
        bool validSpawnPoint = false;

        foreach (Transform fireSpawPointChild in WeaponFireSpawPoint)
        {
            if (fireSpawPointChild.CompareTag(currentAmmo.GetAmmoChildTag()))
            {
                validSpawnPoint = true;
                return(validSpawnPoint);
            }
        }
        return(validSpawnPoint);
    }