Beispiel #1
0
    public void Shoot(GameObject go)
    {
        //Instantiate(gameSettings.ShootingEffect, muzzleMain.transform.position, muzzleMain.rotation);
        ObjectPoolScript.Spawn(gameSettings.ShootingEffect, muzzleMain.transform.position, muzzleMain.rotation);
        //GameObject missleGo = Instantiate(gameSettings.Bullet, muzzleMain.transform.position, muzzleMain.rotation);
        GameObject missleGo   = ObjectPoolScript.Spawn(gameSettings.Bullet, muzzleMain.transform.position, muzzleMain.rotation);
        Projectile projectile = missleGo.GetComponent <Projectile>();

        projectile.target = currentTarget.transform;
    }
Beispiel #2
0
 void SpawnPrefab()
 {
     ObjectPoolScript.Spawn(prefabToSpawn, transform.position, transform.rotation);
 }