Beispiel #1
0
    /// <summary>
    /// Spawns the ally.
    /// </summary>
    /// <param name="_type">The type of ally to spawn.</param>
    public void SpawnAlly(int _type)
    {
        GameObject ally = Instantiate(allies [_type], AllySpawn.position, Quaternion.identity) as GameObject;

        ally.transform.localScale = new Vector3(1, 1, 1);
        ally.transform.SetParent(Canvas);
        AllyScript AS = ally.GetComponent <AllyScript> ();

        AS.TM = this;
    }
Beispiel #2
0
    void OnTriggerEnter(Collider hit)
    {
        if (hit.tag == "Ally")
        {
            _isAttacking     = true;
            _isAttackingAlly = true;
            _ally            = hit.GetComponent <AllyScript> ();
        }
        if (hit.tag == "Tower")
        {
            _tower.TakeDamage(_attackDmg);
            ES.DestroyEnemy();
            Destroy(this.gameObject);
        }
//		if (hit.tag == "Enemy") {
//			_canMove = false;
//		}
    }