public void OnDestroy() { DamCollector collector = FindObjectOfType <DamCollector>(); if (collector != null) { collector.OnLogPlaced -= Collector_OnLogPlaced; } }
public void Start() { DamCollector collector = FindObjectOfType <DamCollector>(); collector.OnLogPlaced += Collector_OnLogPlaced; targetPosition = -1; DamLevel = -1; }