public override void HitByEntity(Entity col) { if (col.gameObject.tag == "PlayerBullet") { hit = true; HealthDisplayManager.Instance.SetRightEntity(this); } }
public void entityDied(Entity entity) { Managers.GameManager.Menu(); Error.SetActive(true); introSongs.loop = true; introSongs.loopSong = 2; introSongs.PlaySong(2); }
public bool Shoot(Enums.BulletTypes type, Transform loc, Enums.Direction direction, ref Entity bullet, bool isCutScene = false) { try { if (isCutScene) return AquireEntityCutScene((int)type, loc, direction); return AquireEntity((int)type, loc, direction, ref bullet); } catch (System.IndexOutOfRangeException ex) { Debug.LogError("Error: Invalid Bullet Type. : " + ex.Message); return false; } }
public void entityDied(Entity entity) { if(intro) UnityEngine.SceneManagement.SceneManager.LoadScene("Secret"); if (mf) { count++; if (count < 2) return; } WinText.SetActive(true); GameManager.CutScene(); waitForCutScene = true; }
/// <summary> Readies an entity if one is available. </summary> /// <param name="type"> The type of entity to acquire. </param> /// <param name="loc"> The location to spawn the entity in. </param> /// <param name="direction"> The direction the entity should initially face. </param> /// <param name="entity"> Will contain the entity that is acquired. </param> /// <param name="callback"> The object to send a message to upon the aquired entites death. </param> /// <returns> True if an entity was able to be readied. </returns> protected bool AquireEntity(int type, Transform loc, Enums.Direction direction, ref Entity entity, Callback callback = null) { if (type >= entities.Length || type < 0) throw new System.IndexOutOfRangeException("Invalid Entity Type. "); for(int i = 0; i < entities[type].Length; i++) { if(!entities[type][i].active) { entities[type][i].active = true; entities[type][i].entity.gameObject.SetActive(true); entities[type][i].callback = callback; entities[type][i].entity.Init(loc, this, type, i, direction, false); entity = entities[type][i].entity; return true; } } return false; }
/// <summary> /// Entity Update Method. Replaces Update(). /// </summary> public override void RunEntity() { base.RunEntity(); if ((attackTimer -= Time.deltaTime) < 0) { if (attackTimer > -1) { // Charge the attack. } else if (attackStartTime == 0) { // Create a beam. Enums.Direction direction = transform.localScale.x > 0 ? Enums.Direction.Left : Enums.Direction.Right; bulletManager.Shoot(Enums.BulletTypes.Beam, wand, direction, ref beam); attackStartTime = attackTimer; animator.SetBool("Attack", true); } else if (attackTimer < attackStartTime - 1) { animator.SetBool("Attack", false); // Resume walking. SetAttackTimer(); beam = null; } if (beam != null) { beam.transform.position = wand.position; } } else { bool inAir = false, blocked = false; TouchingSomething(ref inAir, ref blocked); if (blocked) { Turn(); } transform.Translate(GetForward() * speed * Time.deltaTime); } }
public override void HitByEntity(Entity col) { }
public void entityDied(Entity entity) { GameManager.Dead = true; canvas.SetActive(true); }
public override void HitByEntity(Entity col) { if (col.gameObject.tag == "PlayerBullet") { SetHit(col.gameObject.GetComponent<Bullets.Bullet>().getDamage()); } else if (col.gameObject.layer == 8) { ExplosionWave explosion = col.gameObject.GetComponent<ExplosionWave>(); if (explosion != null) { SetHit(explosion.getDamage()); } } }
public void entityDied(Entity entity) { numOfEnemies--; }
public void entityDied(Entity entity) { WinText.SetActive(true); GameManager.Intro(); }
public override void HitByEntity(Entity col) { if (col.gameObject.tag == "Enemy") { SetHit(col.gameObject.GetComponent<Enemy.Enemy>().CollideDamage); } else if (col.gameObject.tag == "EnemyBullet") { SetHit(col.gameObject.GetComponent<Bullet>().getDamage()); } }
public override void HitByEntity(Entity col) { if (col.gameObject.tag == "Enemy") hit = true; }
/// <summary> Called when a collision is detected by another entity. </summary> /// <param name="col"> The entity colliding with this one. </param> public abstract void HitByEntity(Entity col);
public void entityDied(Entity entity) { WinText.SetActive(true); GameManager.Intro(); waitForCutScene = true; }
public void SetRightEntity(Entity e) { rightHealthDisplay.gameObject.SetActive(true); rightHealthDisplay.Entity = e; }
public void SetLeftEntity(Entity e) { leftHealthDisplay.Entity = e; }
public override void HitByEntity(Entity col) { if (col.gameObject.tag == "PlayerBullet") hit = true; }