Beispiel #1
0
    private void Shoot()
    {
        GameObject BulletGO = (GameObject)Instantiate(ArrowPrefab, FirePoint.position, FirePoint.rotation);

        if (gameObject.tag == "ArcherTower")
        {
            NormalBullet _Bullet = BulletGO.GetComponent <NormalBullet>();
            if (_Bullet != null)
            {
                _Bullet.seek(target, TargetGO);
                _Bullet.GetDamage(Damage, PhysicalDamage, MagicalDamage);
            }
        }
        if (gameObject.tag == "BomberTower")
        {
            BulletSc _Bullet = BulletGO.GetComponent <BulletSc>();
            if (_Bullet != null)
            {
                _Bullet.seek(target, TargetGO);
                _Bullet.GetDamage(Damage, PhysicalDamage, MagicalDamage);
                _Bullet.GetTowerPosition(gameObject.transform.position);
            }
        }
        if (gameObject.tag == "CrystalTower")
        {
            NormalBullet _Bullet = BulletGO.GetComponent <NormalBullet>();
            if (_Bullet != null)
            {
                _Bullet.seek(target, TargetGO);
                _Bullet.GetDamage(Damage, PhysicalDamage, MagicalDamage);
                _Bullet.GetTowerPosition(gameObject.transform.position);
            }
        }
    }