public void OnApplicationStart() { if (Instance != null) { return; } Instance = this; ChatHandler.OnLoad(); Task.Run(() => TwitchWebSocketClient.Initialize()); SceneManager.activeSceneChanged += SceneManager_activeSceneChanged; SceneManager.sceneLoaded += SceneManager_sceneLoaded; SharedCoroutineStarter.instance.StartCoroutine(CheckIfUserHasEnteredChannelName()); }
public void Awake() { Instance = this; DontDestroyOnLoad(gameObject); // Startup the texture downloader and anim controller new GameObject("EnhancedTwitchChatTextureDownloader").AddComponent <ImageDownloader>(); new GameObject("EnhancedTwitchChatAnimationController").AddComponent <AnimationController>(); // Stop config updated callback when we haven't switched channels lastChannel = Config.Instance.TwitchChannelName; // Initialize the chats UI InitializeChatUI(); // Subscribe to events Config.Instance.ConfigChangedEvent += PluginOnConfigChangedEvent; initialized = true; Plugin.Log("EnhancedTwitchChat initialized"); }