void Update() { if (dead) { return; } if (gameController.isPaused) { return; } if (hurtable.time < 0) { StartCoroutine("Kill"); } if (Input.GetMouseButtonDown(0)) { Fire(); } float latestHit = hurtable.GetHitQueueNext(); if (latestHit != 0) { Hit(latestHit); } }
void Update() { if (hurtable.time <= 0) { Destroy(gameObject); } if (lastMove + moveDelay < Time.time && !moving) { StartCoroutine("MoveToRandom"); } float latestHit = hurtable.GetHitQueueNext(); if (latestHit != 0 && hurtable.time <= 0) { playerController.hurtable.Hit(-10, true); } }