public void Chill() { enemyHp = null; enemyTransform = null; StartCoroutine(Searching()); attacking = false; }
public void Stack(Collider2D coll) { Rigidbody2D rb = coll.GetComponent <Rigidbody2D>(); if (rb != null) { rb.AddForce((bullet.position - characterctrl.me.position).normalized * (1f * hit)); } hpBase hp = coll.GetComponent <hpBase>(); if (hp != null) { hp.AddHit(hit, bullet.position); } if (coll.gameObject.layer == 11) { fxHub.me.GimmeParticles(particleType.DirtSplash, bullet.position); } if (laser) { return; } Destroy(bullet.gameObject); Destroy(shell.gameObject); Destroy(gameObject); }
new private void Start() { base.Start(); HashedFlight = Animator.StringToHash("flight"); HashedIdem = Animator.StringToHash("idem"); HashedPunch = Animator.StringToHash("punch"); target = characterctrl.me; targetHp = characterctrl.it; StartCoroutine(Walking()); }
protected new void Start() { base.Start(); startLightColor = timeCtrl.me.sunLight.color; timeCtrl.me.sunLight.color = myLightColor; fxHub.me.ShakeMe(10); targetHp = characterctrl.it; target = characterctrl.me; StartCoroutine(Lifetime()); }
public void ShowNpcStats(hpBase hp) { if (targetHp != null) { targetHp.addHitEvent.RemoveListener(RefreshStats); } targetHp = hp; targetHp.addHitEvent.AddListener(RefreshStats); targetTransform = hp.transform; nameOfNpc = hp.nameOfNpc; RefreshStats(); }
private IEnumerator Searching() { chillingPosRoutine = StartCoroutine(ChillingPosUpdate()); while (enemyHp == null) { float dist = triggerDistance; //not bruh anymore foreach (hpBase target in characterctrl.NearNpcs) { float newDist = Vector3.SqrMagnitude(target.transform.position - transform.position); if (dist > newDist && target.hp != 0) { dist = newDist; enemyHp = target; enemyTransform = enemyHp.transform; } } yield return(new WaitForSeconds(0.1f)); } }