void Update() { if (_shipCondition == null) { return; } _timer += Time.deltaTime; if (_timer > _delay) { _timer = 0; _shipCondition.TakeDamage(1); } }
public void TakeDamage() { if (_broken) { return; } _broken = true; _shipCondition.TakeDamage(); if (_particleSystem == null) { Debug.LogError(gameObject.name + " missing particle system"); } else { Instantiate(_particleSystem, transform.position, Quaternion.identity); } _fixableShipPart.SetActive(false); }