コード例 #1
0
    public override void shoot(TankScore score, Statics.Player playerNum, Transform spawnTrans)
    {
        currentSpecialAmmo--;


        //Bullet Spawning
        var mine = PowerUpPool.GetObject();

        mine.SetActive(true);
        mine.transform.position = spawnTrans.transform.position;
        mine.transform.up       = spawnTrans.transform.up;

        var mineProperties = mine.GetComponent <TankMine>();

        mineProperties.score     = score;
        mineProperties.playerNum = playerNum;
    }
コード例 #2
0
    public override void shoot(TankScore score, Statics.Player playerNum, Transform spawnTrans)
    {
        currentSpecialAmmo--;

        var grenade = PowerUpPool.GetObject();

        grenade.SetActive(true);
        grenade.transform.position = spawnTrans.transform.position;
        grenade.transform.up       = spawnTrans.transform.up;
        Vector2 vel = grenade.transform.up * grenadeSpeed;

        grenade.GetComponent <Rigidbody2D>().velocity = vel;

        TankGrenade grenadeProperties = grenade.GetComponent <TankGrenade>();

        grenadeProperties.startPos  = spawnTrans.position;
        grenadeProperties.playerNum = playerNum;
        grenadeProperties.score     = score;
    }
コード例 #3
0
    public override void shoot(TankScore score, Statics.Player playerNum, Transform spawnTrans)
    {
        currentSpecialAmmo--;


        //Bullet Spawning
        var bullet = PowerUpPool.GetObject();

        bullet.SetActive(true);
        bullet.transform.position = spawnTrans.transform.position;
        bullet.transform.up       = spawnTrans.transform.up;
        Vector2 vel = bullet.transform.up * bulletSpeed;

        bullet.GetComponent <Rigidbody2D>().velocity = vel;

        //Score and Owner
        TankBullet bulletProperties = bullet.GetComponent <TankBullet>();

        bulletProperties.frontalDamage = frontDamage;
        bulletProperties.normalDamage  = normalDamage;
        bulletProperties.playerNum     = playerNum;
        bulletProperties.score         = score;
    }