private void OnTriggerStay2D(Collider2D _collision) { AvatarStatsHandler stats = _collision.GetComponent <AvatarStatsHandler>(); if (stats != null && action.target == null) { action.target = stats; } }
public virtual void Attack(AvatarStatsHandler _target) { if (_target == null) { target = _target; } if (target != _target && canChangeTarget == false) { return; } if (target != _target && canChangeTarget) { target = _target; } StartCoroutine(AttackLoop()); }
private void Update() { if (target == null) { return; } if (target.gameObject.activeSelf == false) { target = null; } if (timer.IsTimerUp()) { Projectile currentProjectile = Pooling.GetObject(projectile); currentProjectile.transform.position = shootingPoint.position; currentProjectile.gameObject.layer = gameObject.layer; currentProjectile.Fire(target.transform, stats.actionAmount); } }
public override void Attack(AvatarStatsHandler _target) { base.Attack(_target); }