예제 #1
0
        private void OnButtonClick(ButtonValue value)
        {
            if (_dialogListener != null)
            {
                _dialogListener.OnClick(value);
            }

            OnBeforeDestroy?.Invoke();
            Destroy(this.gameObject);
        }
예제 #2
0
        /// <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);
 }