private void OnButtonClick(ButtonValue value) { if (_dialogListener != null) { _dialogListener.OnClick(value); } OnBeforeDestroy?.Invoke(); Destroy(this.gameObject); }
/// <summary> /// Destroy the component from the DOM tree /// </summary> public async Task DestroyAsync() { var cancel = new CancelEventArgs(); if (OnBeforeDestroy.HasDelegate) { await OnBeforeDestroy.InvokeAsync(cancel); } _hasAdd = cancel.Cancel; await InvokeStateHasChangedAsync(); }
private void selfDestruct() { OnBeforeDestroy?.Invoke(); Destroy(gameObject); }