void Awake() { homingCollider = GetComponent <CircleCollider2D>(); homingCollider.radius *= homingColliderRadius; myBullet = GetComponentInParent <RocketBullet>(); collisionMask = LayerMask.GetMask("Ground"); }
void Fire() { AudioManager._instance.PlaySoundEffect(sound); RocketBullet rb = Instantiate(bullet, bulletSpawnpoint.position, bulletSpawnpoint.rotation).GetComponent <RocketBullet>(); rb.SetTarget(target); }
public override void loadResources() { bullet = (GameObject)Resources.Load("Prefabs/WeaponPrefabs/RocketBullet", typeof(GameObject)); myBullet = bullet.GetComponent <RocketBullet>(); rocketBullet = bullet.GetComponent <RocketBullet>(); rocketBullet.loadResources(); }
public void Cast(Player player) { if (rocketSpawn == null) { rocketSpawn = (RocketBullet)player.CreateBullet(rocketBullet); rocketSpawn.explosionRadius = explosionRadius; rocketSpawn.Shoot(); } else { rocketSpawn.HitTarget(rocketSpawn.gameObject); rocketSpawn = null; } }
// Use this for initialization void Start() { rocketBullet = GetComponent <RocketBullet> (); }