Beispiel #1
0
        public void Close(Action onClosed)
        {
            if (CurrentProvider == null)
            {
                throw new NullReferenceException("有効なDialogPlayerがありません。");
            }

            CurrentProvider.Close(onClosed);

            CurrentProvider = null;
        }
Beispiel #2
0
        public void Open(string providerName, Action onOpened)
        {
            if (CurrentProvider != null)
            {
                throw new InvalidOperationException("すでに別のDialogProviderが有効です。");
            }

            if (!string.IsNullOrEmpty(providerName))
            {
                CurrentProvider = providers.FirstOrDefault(p => p.ProviderName == providerName);
            }
            else
            {
                CurrentProvider = providers[0];
            }


            if (CurrentProvider == default)
            {
                throw new NullReferenceException($"指定されたDialogProvider \"{providerName}\" は見つかりませんでした。");
            }

            CurrentProvider.Open(onOpened);
        }