void Update() { deltaMove = Time.deltaTime * 1; if (Mathf.Abs(transform.position.x) > 0.1f || Mathf.Abs(transform.position.y) > 0.1f) { transform.position += diffPosition * deltaMove; } else { Destroy(gameObject); } time += Time.deltaTime; if (time >= spawnTime) { SpawnBullet(); SetSpawnTime(); } if (healthScript.health <= 0.0f && !dead) { dead = true; DropCollectible(); healthScript.Die(); } }
void Agony() { if (count > 0) { count -= 1; resCounter.text = count.ToString(); } else { hp.Die(); } }
private void OnTriggerEnter2D(Collider2D other) { if (other.transform.gameObject.CompareTag("Whiskey")) { hs.Die(); } if (other.transform.gameObject.CompareTag("IDcardTrigger")) { PlayerShootingL3Script ss = transform.gameObject.GetComponent <PlayerShootingL3Script>(); ss.EnableShooting(); } }