public void Setup(ProjectilePoolManager pool) { this.pool = pool; IsReady = false; Setup(); }
public override void Setup() { base.Setup(); projectileManager = new ProjectilePoolManager(50); targets = new List <HealthController>(); }
// __________________________________________________________________________________________METHODS public override void Setup() { healthController.Setup(100); ProjectilePoolManager projectileManagerPlayer = new ProjectilePoolManager(50); weaponController.Setup(projectileManagerPlayer); }
void Awake() { //turn off muzzle art if (MuzzleArt) { MuzzleArt.SetActive(false); } projectilePool = GameObject.Find("Enemy Projectile Pool").GetComponent <ProjectilePoolManager>(); }
void OnTriggerEnter2D(Collider2D col) { if (col.tag == "Border") { gameObject.SetActive(false); ProjectilePoolManager enemyProjectile = GameObject.Find("Enemy Projectile Pool").GetComponent <ProjectilePoolManager>(); if (enemyProjectile) { enemyProjectile.ReturnProjectileToPool(this.gameObject); } } }
IEnumerator CountdownToLife() { yield return(new WaitForSeconds(LifeDuration)); if (Explosion) { Instantiate(Explosion, transform.position, transform.rotation); } ProjectilePoolManager pool = GameObject.Find("Enemy Projectile Pool").GetComponent <ProjectilePoolManager>(); if (pool) { Debug.Log("Return"); this.gameObject.SetActive(false); pool.ReturnProjectileToPool(this.gameObject); } }
void Awake() { current = this; }
public void Setup(Vector3 direction, float speed, float health, float size, float skill, List <HealthController> targets, ProjectilePoolManager projectileManager, System.Action <Saucer> onDeath) { base.Setup(direction, speed, health, size, null); this.skill = skill; this.targets = targets; SelectNewTarget(); weaponController.Setup(projectileManager); if (onDeath != null) { healthController.onDeath += (() => { onDeath.Invoke(this); }); } healthController.onDamage += OnDamage; }