private IEnumerator LoadChatLogAsset() { yield return(AssetBundleLoader.LoadUIAsset(CHAT_LOG_ASSET, "PlayerChatCanvas", true, playerChatGameObject => { playerChat = playerChatGameObject.AddComponent <PlayerChat>(); })); yield return(playerChat.SetupChatComponents()); }
public PlayerChatManager() { if (chat == null) { chat = new GameObject().AddComponent <PlayerChat>(); } if (chatEntry == null) { chatEntry = new GameObject().AddComponent <PlayerChatEntry>(); } }
public PlayerChat() { if (instance != null) { throw new Exception($"There must only be one {nameof(PlayerChat)} instance."); } instance = this; chatLog = new GameObject().AddComponent <PlayerChatLog>(); chatLog.Manager = this; inputField = new GameObject().AddComponent <PlayerChatInputField>(); inputField.Manager = this; }
public PlayerChat() { if (NitroxEnvironment.IsNormal && instance != null) { throw new Exception($"There must only be one {nameof(PlayerChat)} instance."); } instance = this; chatLog = new Lazy <PlayerChatLog>(() => { PlayerChatLog chatlog = new GameObject().AddComponent <PlayerChatLog>(); chatlog.Manager = this; return(chatlog); }); inputField = new Lazy <PlayerChatInputField>(() => { PlayerChatInputField inputfield = new GameObject().AddComponent <PlayerChatInputField>(); inputfield.Manager = this; return(inputfield); }); }