Пример #1
0
 public override void HitByEntity(Entity col)
 {
     if (col.gameObject.tag == "PlayerBullet")
     {
         hit = true;
         HealthDisplayManager.Instance.SetRightEntity(this);
     }
 }
Пример #2
0
 public void entityDied(Entity entity)
 {
     Managers.GameManager.Menu();
     Error.SetActive(true);
     introSongs.loop = true;
     introSongs.loopSong = 2;
     introSongs.PlaySong(2);
 }
Пример #3
0
 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;
     }
 }
Пример #4
0
 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;
 }
Пример #5
0
 /// <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;
 }
Пример #6
0
 /// <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);
     }
 }
Пример #7
0
 public override void HitByEntity(Entity col)
 {
 }
Пример #8
0
 public void entityDied(Entity entity)
 {
     GameManager.Dead = true;
     canvas.SetActive(true);
 }
Пример #9
0
 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());
         }
     }
 }
Пример #10
0
 public void entityDied(Entity entity)
 {
     numOfEnemies--;
 }
Пример #11
0
 public void entityDied(Entity entity)
 {
     WinText.SetActive(true);
     GameManager.Intro();
 }
Пример #12
0
 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());
     }
 }
Пример #13
0
 public override void HitByEntity(Entity col)
 {
     if (col.gameObject.tag == "Enemy")
         hit = true;
 }
Пример #14
0
 /// <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);
Пример #15
0
 public void entityDied(Entity entity)
 {
     WinText.SetActive(true);
     GameManager.Intro();
     waitForCutScene = true;
 }
Пример #16
0
 public void SetRightEntity(Entity e)
 {
     rightHealthDisplay.gameObject.SetActive(true);
     rightHealthDisplay.Entity = e;
 }
Пример #17
0
 public void SetLeftEntity(Entity e)
 {
     leftHealthDisplay.Entity = e;
 }
Пример #18
0
 public override void HitByEntity(Entity col)
 {
     if (col.gameObject.tag == "PlayerBullet")
         hit = true;
 }