Exemple #1
0
    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "enemyBullet")
        {
            healthTracker ht = GetComponentInParent <healthTracker> ();
            ht.damagePlayer(ht.maxHealth / 10);

            other.gameObject.GetComponent <enemyBullet> ().playHitSound();
        }
    }
Exemple #2
0
 // Use this for initialization
 private void OnEnable()
 {
     nextHex   = null;
     healthOrb = GetComponent <healthTracker>();
     //healthOrb.SetHealth(1);
     effectList     = new List <MobEffect>();
     clumpMobs      = new List <mobBase>();
     collider       = GetComponent <CapsuleCollider>();
     agent          = GetComponent <NavMeshAgent>();
     agent.enabled  = false;
     destinationSet = false;
 }
Exemple #3
0
 private void OnEnable()
 {
     building    = Building.no;
     modelObject = this.GetComponentInChildren <MeshRenderer>().gameObject;
     StartBuilding();
     keepLinks          = new List <GameObject>();
     links              = new Dictionary <GameObject, LinkType>();
     autoLink           = true;
     healthBar          = GetComponent <healthTracker>();
     buildingProperties = new List <BuildingProperties>();
     linksMax           = 1;
     updateLinks        = true;
     updateDelay        = 10;
 }