Ejemplo n.º 1
0
    void Update()
    {
        this.transform.position += Time.deltaTime * this.speed * this.transform.forward.normalized;

        if (lookAtTarget)
        {
            this.transform.LookAt(target.elementObject.transform.position);
            lookAtTarget = false;
        }
        if ((this.transform.position - target.elementObject.transform.position).sqrMagnitude < 0.5f)
        {
            target.ChangeStats(ELEMENTSTATS.HEAL, this.bulletDamage);
            UnityEngine.Object.Destroy(this.gameObject);
        }

        if ((this.transform.position - target.elementObject.transform.position).sqrMagnitude > 30f)
        {
            UnityEngine.Object.Destroy(this.gameObject);
        }
    }
Ejemplo n.º 2
0
 void Test(GameElement target, bool enter)
 {
     target.ChangeStats(ELEMENTSTATS.ITEMSCOUNT, this.itemData.valueItem);
     this.elementObject.SetActive(false);
 }
Ejemplo n.º 3
0
 void Test(GameElement target, bool enter)
 {
     target.ChangeStats(ELEMENTSTATS.HEAL, this.obstacleData.damage);
     this.elementObject.SetActive(false);
 }