Esempio n. 1
0
    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);
        }
    }
Esempio n. 2
0
    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);
            }
        }
    }
Esempio n. 3
0
 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!");
     }
 }
Esempio n. 4
0
    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);
        }
    }
Esempio n. 5
0
    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);
            }
        }
    }