protected override void SpawnBullet() { base.SpawnBullet(); IceProjectile bullet = iceProjectilePool.Rent() as IceProjectile; SetUpBullet(bullet); }
/* When this function is entered, we check if the trigger that entered the collider was an ice spell projectile. If * it was, we change the material of the water to an ice material, enable the block's collider so it can be walked * on (freeze the water), and start a new timer that, when finished, will thaw the ice. */ void OnTriggerEnter(Collider hitInfo) { IceProjectile iceBall = hitInfo.GetComponent <IceProjectile>(); if (iceBall != null) { Debug.Log("*Freezing*"); this.GetComponent <Renderer>().material = ice; waterBlockCollider.enabled = true; iceTimer = new Timer(countDown, Time.time); } }
void PewPew() { GameObject newProjectile = Instantiate(projectile, firePoint.position, transform.rotation); newProjectile.GetComponent <IceProjectile>().damage = damage; newProjectile.GetComponent <IceProjectile>().speed = shotSpeed; IceProjectile projectileScript = newProjectile.GetComponent <IceProjectile>(); if (projectileScript != null) { projectileScript.Seek(target); } }
void ReturnToPool(IceProjectile projectileToReturn) { iceProjectilePool.UnRent(projectileToReturn); }
void SetUpBullet(IceProjectile bullet) { bullet.SetTarget(target); bullet.transform.position = projectileSpawnPoint.transform.position; bullet.gameObject.SetActive(true); }