| | 1 | | using DCL.Helpers; |
| | 2 | | using DCL.Providers; |
| | 3 | | using System.Threading; |
| | 4 | | using UnityEngine; |
| | 5 | |
|
| | 6 | | namespace DCL.Social.Chat |
| | 7 | | { |
| | 8 | | public class PromoteChannelsToastPlugin : IPlugin |
| | 9 | | { |
| 0 | 10 | | private readonly CancellationTokenSource cts = new (); |
| | 11 | |
|
| | 12 | | private PromoteChannelsToastComponentController promoteChannelsToastController; |
| | 13 | |
|
| 0 | 14 | | public PromoteChannelsToastPlugin() |
| | 15 | | { |
| 0 | 16 | | Initialize(cts.Token); |
| 0 | 17 | | } |
| | 18 | |
|
| | 19 | | private async void Initialize(CancellationToken ct) |
| | 20 | | { |
| 0 | 21 | | var view = await Environment.i.serviceLocator.Get<IAddressableResourceProvider>() |
| | 22 | | .Instantiate<PromoteChannelsToastComponentView>("PromoteChannelsHUD", cancellati |
| | 23 | |
|
| 0 | 24 | | promoteChannelsToastController = new PromoteChannelsToastComponentController( |
| | 25 | | view, new DefaultPlayerPrefs(), DataStore.i, CommonScriptableObjects.rendererState); |
| 0 | 26 | | } |
| | 27 | |
|
| | 28 | | public void Dispose() |
| | 29 | | { |
| 0 | 30 | | cts.Cancel(); |
| 0 | 31 | | cts.Dispose(); |
| 0 | 32 | | promoteChannelsToastController.Dispose(); |
| 0 | 33 | | } |
| | 34 | | } |
| | 35 | | } |