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); } }
void Test(GameElement target, bool enter) { target.ChangeStats(ELEMENTSTATS.ITEMSCOUNT, this.itemData.valueItem); this.elementObject.SetActive(false); }
void Test(GameElement target, bool enter) { target.ChangeStats(ELEMENTSTATS.HEAL, this.obstacleData.damage); this.elementObject.SetActive(false); }