public void OnTriggerEnter(Collider col) { if (col.tag == "Ant_M") { AntMember ant = col.gameObject.GetComponent <AntMember>(); ant.Health += HealthPointToAdd; Debug.Log("Food Found"); Destroy(gameObject); } }
public void OnCollisionEnter(Collision col) { if (col.collider.tag == "Ant_M") { AntMember ant = col.collider.gameObject.GetComponent <AntMember>(); if (!ant.IsKilled) { ant.Health -= HitPoints; _anim.SetBool("Attack", true); } } }
public void DeployAnt(int colonyNumber) { if (_antsDeployed < MaxAnts) { _antsDeployed += 1; AntMember ant = Instantiate(AntPrefab, AntColonySpawns[colonyNumber].transform.position, Quaternion.identity).GetComponent <AntMember>(); } else { Debug.Log("Not enough ants to deploy!"); } }
public void OnTriggerEnter(Collider col) { if (col.tag == "Ant_M") { AntMember ant = col.gameObject.GetComponent <AntMember>(); ant.SandParticles += 1; ant.ParticleFound = true; ant.Target = null; GameManager.Instance.NumParticlesFound += 1; GameManager.Instance.RemoveItem(this.gameObject); Destroy(gameObject); } }
public void OnTriggerEnter(Collider col) { if (col.tag == "Ant_M") { AntMember ant = col.gameObject.GetComponent <AntMember>(); if (ant.ParticleFound) { GameManager.Instance.ParticlesFound += 1; Debug.Log("Particle Found"); SoundManager.Instance.PlaySound(SoundManager.POS_HIT_AUDIO); } if (ant.IsDeployed) { GameManager.Instance.AntsDeployed -= 1; Destroy(col.gameObject); } } }