private void Start() { _health = objective.GetComponent <Health>(); _health.onDie += OnDie; _trans = GetComponent <AutoTranslation>(); }
// Start is called before the first frame update private void Start() { _health = GetComponent <Health>(); _health.onDie += OnDie; if (isToggle) { _rhealth = GetComponent <ResettableHealth>(); if (!_rhealth) { throw new MissingComponentException("Toggleable trigger requires ResettableHealth"); } } _trans = GetComponent <AutoTranslation>(); _trans.OnStopped += StoppedMoving; }